Bold text

Bringing your stacks to the web

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
GregWills
Posts: 69
Joined: Sun Aug 30, 2015 7:51 am

Bold text

Post by GregWills » Mon Jul 24, 2017 6:16 am

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

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Bold text

Post by bogs » Mon Jul 24, 2017 11:32 am

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.
Image

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Bold text

Post by [-hh] » Mon Jul 24, 2017 12:37 pm

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).
shiftLock happens

GregWills
Posts: 69
Joined: Sun Aug 30, 2015 7:51 am

Re: Bold text

Post by GregWills » Thu Jul 27, 2017 2:13 am

Thank you bogs and -hh for your comments.

For me, for now, it will have to wait :-)

Cheers

Greg

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Bold text

Post by bogs » Thu Jul 27, 2017 4:44 am

No problems Greg, let us know how you get along with it (I am sure hh's posting will help far more).
Image

Post Reply

Return to “HTML5”