Cross-platform fonts...what is everyone else doing?

Judy Perry jperryl at ecs.fullerton.edu
Tue Jul 27 13:30:15 EDT 2004


And, just for fun, try in OS X setting the font to anything *other* than
Lucida Grande (such as, say, Trebuchet MS) and see what happens.  On the
other systems, I still get Lucida something or other (don't recall exactly
which Lucida font I get).

Judy

On Tue, 27 Jul 2004, Frank Leahy wrote:

> Thanks Richard,
>
> I just tested it again, and I can confirm it doesn't work that way --
> when it can't find the specified font, it does not apply the fontStyle
> or fontSize settings.
>
> The Test: I created a test stack with five fields on OSX that had the
> following font, style and size properties:
>
> 1. Nothing set (all default)
> 2. Set bold attribute only
> 3. Set to 14 pt
> 4. Set font = "0"
> 5 Set font = "0" and bold
>
> I added a button that when clicked outputs the textFont, textStyle and
> textSize of each field.  Here are the results:
>
> On Mac OS X:
> 1. blank, blank, blank
> 2. Lucida Grande, bold, 11 (text is bold)
> 3. Lucida Grande, plain, 14 (text is 14pt)
> 4. 0, plain, 12
> 5. 0, bold, 12 (text is bold)
>
> I moved the stack to Windows XP, and it showed:
> 1. blank, blank, blank
> 2. Lucida Grande, bold, 11 (text is NOT bold)
> 3. Lucida Grande, plain, 14 (text is NOT 14pt)
> 4. 0, plain, 12
> 5. 0, bold, 12 (text is NOT bold)
>
> And on Windows 2000:
> 1. blank, blank, blank
> 2. Lucida Grande, bold, 11 (text is NOT bold)
> 3. Lucida Grande, plain, 14 (text is NOT 14pt)
> 4. 0, plain, 12
> 5. 0, bold, 12 (text is NOT bold)
>
> Even worse, I found that even calling "set the textStyle of field
> "Field 2" to bold" on XP and 2000 didn't do anything.  Apparently, when
> it has an unknown textFont (e.g. Lucida Grande or "0"), RunRev won't
> apply either the size or style of the control (field, label, checkbox,
> etc.).  The only way I could get the size and style information to be
> displayed in fields 2-5 of this test were by calling:
>
>     set the textFont of field "Field 2" to ""
>     set the textStyle of field "Field 2" to ""
>     set the textSize of field "Field 2" to ""
>     set the textStyle of field "Field 2" to "bold"
>
> then, finally, the field turned bold.
>
> Bottomline, it looks like the only way to get cross-platform bold
> controls (fields, labels, checkboxes, etc.) is by doing a runtime hack
> to unset all font info, then setting it again.  And if they have their
> system font set to something other than 12 point, watch out, 'cause all
> your carefully sized labels and fields will surely overflow!
>
> Hmmmm, maybe using Arial wasn't such a bad idea after all :-)
>
> -- Frank
>
> p.s. And the baseline problem shows up in this test stack as well --
> the 14pt fields move up 4 pixels on XP and 2000, and the button text
> moves down 1 pixel.



More information about the use-livecode mailing list