no joy with fonts

Richmond Mathewson richmondmathewson at gmail.com
Fri Sep 16 08:47:01 EDT 2011


I'm sorry, I've been rather preoccupied and had intended to reply to 
this yesterday.

I have extensive experience with non-Latin scripts in Livecode.

On 09/16/2011 07:19 AM, Friedrich F. Grohmann wrote:
> There have been recent discussions about cross platform font issues. My
> problem is, at the moment, confined to the platform I'm working on, i.e. Mac
> OS X.
>
> I've built a number of stacks for my students, pretty simple stuff with at
> least two text fields, one for Chinese, the other for Roman. No problems
> with the Chinese text, but with the Roman strange things happened. The font
> of the field was set to "Times Ext Roman". After I started typing in the
> field, text which contains diacritical marks to indicate proper
> pronunciation, and then re-checked the property inspector it turned out that
> the font was now specified as "Times Ext Roman,Russian".
>
> The logic behind that escapes me as I don't use any Cyrillic in the field.
> Removing "Russian" resulted in garbled text and thus I simply kept it as the
> text was at least properly displayed. This was on OS X.5.8.
>
> Now I've moved to a newer machine with Lion installed and things turn out
> ugly. The Chinese is still there untouched, the Roman shows thankfully
> enough the needed diacritical marks but the font has changed. The weird
> thing is that according to Text>  Font, "Use Owner's Font" is checked which
> simply doesn't reflect the actual state of affairs. I copied a chunk of text
> from the field and pasted it into a word processor document (Nisus)
> whereupon the text gets garbled. It is "Lucia Grande."
>
> I've tried inserting openCard and preOpenStack handlers to force the field
> to show "Times Ext Roman," but no way. Selecting the text and setting it to
> the intended font makes it unreadable. Maybe this is just a Mac issue but
> since I used to provide my students with standalones for Macintosh and
> Windows I really wonder what could be done. Any suggestions most welcome.

I hope & trust that ALL your fields are Unicode fields . . .

2 years ago, when I embarked on a similar "adventure" to yours I tried 
setting fields to
fonts such as 'Times Ext Roman' and had Livecode playing "merry hell" 
with my settings.

1. Unless you dive into Unicode this problem will persist.

2. You DO NOT need to set the language at all in a Unicode field.

    set the useUnicode of fld "BlahBlahBlah" to true
    set the textFont of fld "BlahBlahBlah" to "Times Ext Roman"

at which point the characteristics of your textFld should stay 
consistent and not do "funny things" such as you describe.

Your students can either enter text directly (i.e. typing into the 
field), or by some more
rococco way such as via a virtual on-screen keyboard that consists of 
buttons/images containing code such as this:

set the unicodeText of fld "BlahBlahBlah" to the unicodeText of fld 
"BlahBlahBlah" & numToChar(XXXXX)

where 'XXXXX' is the Unicode address of, say, the Chinese Glyph you require.

>
> Fritz
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list