Bold text

Bringing your stacks to the web

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Bold text

Postby 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
GregWills
 
Posts: 28
Joined: Sun Aug 30, 2015 7:51 am

Re: Bold text

Postby 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
bogs
 
Posts: 374
Joined: Sat Feb 25, 2017 10:45 pm

Re: Bold text

Postby [-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
[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Livecode Membership
 
Posts: 1485
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Bold text

Postby 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
GregWills
 
Posts: 28
Joined: Sun Aug 30, 2015 7:51 am

Re: Bold text

Postby 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
bogs
 
Posts: 374
Joined: Sat Feb 25, 2017 10:45 pm


Return to HTML5

Who is online

Users browsing this forum: No registered users and 1 guest