Hi Everyone
I am using the line
set the textStyle of item 1 of line tBoldLineCount of field "Result" to bold
This works as expected in a standalone and the text is bold; but in a HTML5 build, the text is not bold.
Is this a 'feature' of HTML5 still, or is there a work around.
Regards
Greg
Bold text
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Bold text
I don't mess around a lot in the html builder, but using the htmlText would work in both a standalone and the html generated build, I'd guess.
Code: Select all
set the htmlText of item 1 of line tBoldLineCount of field "Result" to bold
HTMLText
Type property
Syntax
set the HTMLText of [chunk of] field to htmlString
get the [effective] HTMLText of [chunk of] field
Summary
Specifies the contents of a field, including all text
styles and paragraph formatting, represented as
HTML tags and special characters represented as HTML entities.
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Bold text
The HTML5 standalone builder is still "experimental". By that, among other basic things, textstyles don't work as usual. Especially setting some text style to bold, by styledText or htmlText, doesn't work if the corresponding bold-variant of the font in use is not available.
The "workaround" is to use for each style a special styled font or font-variant and to add the font file to the standalone (use "copy files"), so that LC can find it and set the font accordingly.
See for example on http://hyperhh.de/html5/ the demo Navigation & 'GraphicBtns', which is from Sept 2015 but was last compiled in Nov 2016 (replace "X.html" with ".zip" for the source and look into the folder fonts of the standalone).
The "workaround" is to use for each style a special styled font or font-variant and to add the font file to the standalone (use "copy files"), so that LC can find it and set the font accordingly.
See for example on http://hyperhh.de/html5/ the demo Navigation & 'GraphicBtns', which is from Sept 2015 but was last compiled in Nov 2016 (replace "X.html" with ".zip" for the source and look into the folder fonts of the standalone).
shiftLock happens
Re: Bold text
Thank you bogs and -hh for your comments.
For me, for now, it will have to wait
Cheers
Greg
For me, for now, it will have to wait
Cheers
Greg
Re: Bold text
No problems Greg, let us know how you get along with it (I am sure hh's posting will help far more).