[another Buglet] & a question about fonts

Raab, Andreas Andreas.Raab at disney.com
Fri Apr 23 01:48:27 UTC 1999


Just briefly:

> I've been snorkeling around in the Squeak fonts code, trying to make sense
> of it; I thought I might take a crack at building a simple font selection
> dialog.  I gather that there are two basic types of fonts supported by
> Squeak, but I'm not really sure how they relate to each other. 
> 
They don't ;-) StrikeFonts are basically bitmaps whereas TrueType fonts are
vector description of shapes.

>  I think that
> most everything uses the StrikeFonts, which apparently are cached in a
> class
> variable.  The comments on the class side explain how to read them in from
> a
> file that is already in StrikeFont format.
> 
> [I don't really know anything about fonts, but I figure "it's just a file
> format and conversion problem", so I proceeded blissfully onward]
> 
Unfortunately it's not that easy - see above. If you have a bitmap font then
all you need to do is getting the bits inside Squeak and you're all set. For
a vector font, however, you have because of quality and display speed to
create bitmap versions first ...

> So I looked at what the file list viewer does when it displays the
> contents
> of True Type fonts; this is really cool & I have a bunch of these on my
> machine.  Apparently, the viewer loads up a TTSampleFontMorph, which knows
> how to display itself nicely in a world.  However, these TTSampleFontMorph
> objects don't seem to have any conversion routines (i.e. self
> asStrikeFont).
> 
.... and this is exactly the problem. There are basically two approaches we
could use: a) Convert the TTFs into alpha bitmaps:
   This would look exactly like the TTSampleMorphs you've seen. They look
great at high-resolutions but once you get to small font sizes they start
looking ugly.
b) Add a TrueType engine:
   This is a LOT of work since there is some significant amount of work to
do for rendering vector fonts at small sizes correctly. I once thought about
this and then (for time constraints) dropped it. If there's anyone out there
who has interest in writing a TTF engine for Squeak I'd be happy to give you
all the information you need for getting started.

> I concluded that True Type support is in the "hey isn't that cool" stage.
> It looks like somebody went to great lengths to make the viewer work, but
> stopped there (maybe I'm mistaken?).
> 
A little - from my point of view the TTF guys are useful if you're want to
create some real big string morphs (the work hasn't been fully completed
though). For actual text hacking with small font sizes nothing beats a well
designed pixel font.

  Andreas
--
+===== Andreas Raab ========= (andreasr at wdi.disney.com) ==+
| Walt Disney Imagineering        Phone: +1 818 544 5016  I
I Glendale, CA                    Fax:   +1 818 544 4544  I
+======< http://isgwww.cs.uni-magdeburg.de/~raab >========+





More information about the Squeak-dev mailing list