[BUG][FIX]FontPlugin glyphs for CRs (was: Re: accented font support in Squeak)

Andreas Raab Andreas.Raab at gmx.de
Sun Oct 7 08:52:11 UTC 2001


John,

> Should you want a further puzzle, I'd be interested in how this works
> for you. Open a text morph. Change the font to something created with
> Andreas' plug in. Change the style to italic.
>
> Under Linux I get correct spacing between italicised characters. On
> Windows they're far too close together.

Not surprising at all - under Linux you're using an italic font that was
synthesized by Squeak. Under Windows (in the presence of the plugin and the
font) you'll actually query the OS again for the italic version. The
reasoning behind this is that many fonts do not look good if they're just
slanted a bit; they really need different characters (and often you'll get
fonts that have very specific glyphs for any of the emphasized versions).

The reason they look too closely spaced is because Squeak has some pretty
strange "italic exclusive" global kerning values (see
StrikeFont>>ascentKern, StrikeFont>>descentKern, and StrikeFont>>baseKern)
[Windows itself uses a more sophisticated spacing scheme than Squeak where
each character has a left-side bearing (can be negative for underhang
characters), an advance width, and a right side bearing (can be negative for
overhang characters)]

These kern values, besides being overly simplistic (just try any script
font - I found that for instance Blackadder ITC or Edwardian Script have
hugely varying values for "H" vs. "y") are also totally inappropriate for
these fonts; in fact messing them up completely.

However, since I had written the font code long ago before these kern values
were added, the code is not aware of it. The fonts itself are aware of the
Windows values (this is what the 'fullWidth' in HostFont is for; they store
the three values mentioned above) so that one possibility to fix this issue
would be to compute an average kern value that might be good enough to work
with Squeak. Unfortunately, I can't tell you how exactly this needs to
look - as I've said these values vary quite broadly and the better way to go
is to fix Squeak instead of the fonts.

Cheers,
  - Andreas





More information about the Squeak-dev mailing list