Fonts & Unicode

Brad Borch brad at activadesign.com
Tue Jul 26 16:49:18 EDT 2005


I've been working through trying to figure out what takes precedence in 
the font applied to unicode text in a field. Here's what I found. Maybe 
this will help someone else avoid frustration.

1. For non-unicode text, the textFont of the object or its parent:
the textFont of the stack >
the textFont of the group >
the textFont of the card >
the textFont of the object

This setting applies to non-unicode text to which no specific inline 
style has been applied.

2. The htmlText of the text includes inline styles that allow fonts to 
be applied: "<font face="Arial" size="18"><b>de</b></font>."

3. If Rev encounters unstyled unicode text, either by being pasted in or 
typing in with an alternate keyboard encoding, it converts it to a 
unicode font. The html of the text includes a font tag and the unicode 
entities:

<font face="Geneva" lang="en-UC">αβδγε</font>

4. If the text pasted in is styled text from a Unicode font, the 
htmlText reflects this:

<font face="TITUS Cyberbit Basic" 
lang="el">αβδφε</font>

Note the "lang='el'" parameter. The "el" stands for "Ellinas," which is 
the Greek word for... Greek. Presumably Rev looks at the range the 
character is in, determines what language it is, and sets this parameter 
accordingly.

So it is possible to get extended characters by by setting the htmlText 
to include entities, or by setting the unicodeText. However, this does 
NOT change the actual font used; Revolution still uses whichever font it 
has determined is the unicode font. On the Mac, it appears to be using 
Lucida Grande. On the PC, it appears to be Arial. I cannot tell because 
the htmlText does not reflect the actual font used to show the unicode 
characters.

Also, if you try to change the font of unicode text using the menu, the 
text gets converted back to single-byte characters.

So, assuming I can install a unicode font on the user's machine, I'm 
still stuck because I have no way to force Rev to use that particular font.




More information about the use-livecode mailing list