Cross Platform Font Layout - current workarounds

Richard Gaskin ambassador at fourthworld.com
Wed Aug 26 05:16:18 EDT 2020


J. Landman Gay wrote:
 > Any bugs you found are certainly based in fact, as you've shown.

That an anomaly is evident is known. The cause and possible remedies, 
however, remain open questions.

Though I briefly dabbled in sending hand-written Postscript to my laser 
printer back in the day (who didn't? Postscript was the future!), I've 
only briefly skimmed the file formats for Postscript and TrueType, and 
of course anyone lacking technical depth in this specialty will be at a 
disadvantage in diagnosing this.

So while I can't presume to know the inner details of what's in play 
here, it may be worth considering Mark Waddingham's input.  There's at 
least some indication he's familiar with how computers work, and he 
knows a thing or two about the internals of LiveCode. :)

Mark had suggested there may be elements within the font file itself 
which can be adjusted to improve rendering across different systems, 
specifically with regard to baseline differences on Windows:
http://lists.runrev.com/pipermail/use-livecode/2020-August/261448.html

A quick search to see how others deal with similar issues yielded a 
corroborating suggestion, described here:

    "One possible solution could be to download the Cutive font (I see
    it has a SIL license) and then run it through the Font Squirrel
    font-face generator. In 'Expert' mode there is an option to 'Fix
    Vertical Metrics' which might be what you are looking for."

And:

    "I came across this problem with a custom font that had been created
    for a client's brand. I opened the TTF font in Font Forge. The way I
    created uniformity with rendering was to adjust the values in
    Element->Font Info->OS/2->Metrics.
    ....
    I have very limited knowledge about fonts but this did fix my
    problem.

https://stackoverflow.com/questions/11726442/font-rendering-line-height-issue-on-mac-pc-outside-of-element

I can't help but wonder if guidance from experienced people who've 
considered this issue in depth may be worth exploring...



If for some reason making the custom font file more complete is 
prohibitive, LC is flexible enough to compensate in just one line by 
adjusting the margins property where needed:

  if the platform is Win32 then set the margins of btn "Label" to 4,8,4,4

Set the adjustment of the second (top) item to whatever you need and 
you're back in business in just a few seconds.

Of course that's just a quick workaround to keep production work on 
schedule at near-zero cost to any project that may need it.

For the longer term, if adding the Win-specific metrics others have 
found success with doesn't resolve this problem, let's explore it further.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list