no joy with fonts

Friedrich F. Grohmann ffgrohmann at
Fri Sep 16 11:59:21 EDT 2011


Thanks for your suggestions.

On Fri, Sep 16, 2011 at 8:47 PM, Richmond Mathewson <
richmondmathewson at> wrote:

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

Maybe my description was not clear enough. I didn't set any language, it was
Livecode which, strangely enough, decided that the transliterated Chinese
(in Roman script) was "Russian".

>   set the useUnicode of fld "BlahBlahBlah" to true

This leads to a "script compile error" under my setup. Not sure why it works
in your case. According to the User Guide:

LiveCode fields and other controls use the UTF-16 encoding for Unicode. In
order to use Unicode in a field or in the labels of controls, paste in
Unicode text, or set the textFont of the control to ",unicode".
Since I'm not pasting anything but type directly in the field, I take the
second approach. However, despite specifying

     set the textFont of fld "xxx" to "Times Ext Roman,unicode"

the font is still "Lucia Grande." No problems with the Chinese, though. It
is only the Roman part which causes me headaches.

Still grateful for any other suggestions.



More information about the Use-livecode mailing list