[Etoys] [Fwd: [squeak-dev] Fwd: A little font rendering speedup]

Karl Ramberg karlramberg at gmail.com
Sun Apr 19 12:26:42 EDT 2009

Maybe for Etoys, too?
I saw a speedup from 8026 to  7558 with about 10 windows open.
What do others think ?

-------- Original Message --------
Subject: 	[squeak-dev] Fwd: A little font rendering speedup
Date: 	Sun, 19 Apr 2009 16:36:19 +0300
From: 	Igor Stasenko <siguctua at gmail.com>
Reply-To: 	The general-purpose Squeak developers list 
<squeak-dev at lists.squeakfoundation.org>
To: 	The general-purpose Squeak developers list 
<squeak-dev at lists.squeakfoundation.org>, Pharo Development 
<Pharo-project at lists.gforge.inria.fr>

I put this on mantis, since i'm sure this applies to squeak3.10 and Pharo both.


---------- Forwarded message ----------
From: Igor Stasenko<siguctua at gmail.com>
Date: 2009/4/19
Subject: A little font rendering speedup
To: Pharo Development<Pharo-project at lists.gforge.inria.fr>

This is an image-side change, which makes a primitiveDisplayString to
not fail because StrikeFontSet returns nil for (font

Since the code, which using fast primitive looks like following:

        self primDisplayString: aString from: startIndex to: stopIndex
                        map: font characterToGlyphMap xTable: font xTable
                        kern: kernDelta

I thought, why one would return nil in ( font characterToGlyphMap ).
Since #xTable in StrikeFontSet implemented as following:

        "Answer an Array of the left x-coordinate of characters in glyphs."

        ^ (fontArray  at: 1) xTable.

i think it is safe to do similar in characterToGlyphMap ,
this allows the primitive to work w/o failure, because otherwise, if
you look at implementation of

primDisplayString: aString from: startIndex to: stopIndex map:
glyphMap xTable: xTable kern: kernDelta

in fallback code it does same thing again (and ignoring glyphMap at all, btw).

To bench a difference, leave a couple of windows with text in world and then do:

[10 timesRepeat: [World fullDrawOn: World assuredCanvas] ] timeToRun

before change:


after change:


Best regards,
Igor Stasenko AKA sig.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.laptop.org/pipermail/etoys/attachments/20090419/23832f88/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StrikeFontSet-characterToGlyphMap.st
Type: application/octet-stream
Size: 554 bytes
Desc: not available
Url : http://lists.laptop.org/pipermail/etoys/attachments/20090419/23832f88/attachment.obj 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Attached Message Part
Url: http://lists.laptop.org/pipermail/etoys/attachments/20090419/23832f88/attachment.txt 

More information about the Etoys mailing list