Unicode confusion

Dar Scott dsc at swcp.com
Mon Jul 25 20:58:07 EDT 2005


On Jul 25, 2005, at 8:50 AM, Brad Borch wrote:

> Can I force Rev to choose a particular font for Unicode text?

I have had some problems with fonts that were solved by setting the  
font of the owner object.  I don't remember if this applies.

I was testing some large unicode fonts and there were times I would get  
the wrong one.  Bugzilla'd some place.  I think that if the code was in  
some range, Rev would search fonts until it found one that had it and  
use it, even if the current font would work.

I don't use htmlText for unicode.  I use the unicodeText property, so  
I'm not aware of all the htmlText problems.  One of the things I  
noticed is that space should be outside of <font> in most cases; I  
don't know why.  In many cases, if the space is in the font, garbage  
comes out.  It will also work to code the space as  .  I usually  
see the lang as "jp" for unicode text for some reason.

Here is something that will set a field to the Greek text you mentioned  
before:

on mouseUp
   get  
decimalCodesToUnicode("945,946,947,948,949,32,949,955,955,949,957,953,95 
4,945")
   set the unicodeText of field "Greek" to it
end mouseUp

function decimalCodesToUnicode s
   set the useUnicode to true
   repeat for each item c in s
     put numToChar(c) after u
   end repeat
   return u
end decimalCodesToUnicode

If you get text and set text always with unicodeText, maybe it will  
work better for you.

You can't use unicode yet in the script editor, though I think there is  
a way to cheat with some special tools.

Dar
-- 
**********************************************
     DSC (Dar Scott Consulting & Dar's Lab)
     http://www.swcp.com/dsc/
     Programming and software
**********************************************




More information about the use-livecode mailing list