[Squeakfoundation]re: TrueType font support and 3.6

Ned Konz ned at bike-nomad.com
Fri Jun 20 21:33:35 CEST 2003


On Friday 20 June 2003 07:02 pm, Tim Rowledge wrote:

> It's the using, which as you say isn't totally unexpected. Oddly
> enough it seems fine in menus _after_ the first time the menu is
> popped up (presumably the initial rendering) but in text panes it's
> _really_ slow. As Craig says, it's ok on his machine (I've seen it)
> but my machine is about one third the performance overall and when
> on the margin a factor of three can seem enormous. Typing in a
> morph is already excruciating even with boring strikefonts.

The glyphs are cached. However, the font holds onto the cache weakly. 
As soon as there aren't any TT glyphs being drawn in a particular 
font and there's a GC, the cache gets dumped.

Plus, the caches can only hold a single color->form per character 
code. So if you have text with (say) A's of alternating colors in the 
same size, the cache will not do any good at all, and you'll spend 
all your time re-computing the forms.

Try this to see how fast your machine renders the characters:

string := String withAll: ((Character value: 0) to: (Character value: 
255)).
TTCFont recreateCache.
time := (Time millisecondsToRun: [ TTCFont allInstancesDo: [ :f | f 
widthOfString: string ]]) / TTCFont allInstances size.
time := time / 256.0.

On my 900 MHz Transmeta machine, I get about 1.45 milliseconds per 
character. On my 1200 MHz Duron desktop, I get about 0.70 
milliseconds per character.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeakfoundation mailing list