[GOODIE] Freetype/2 antialiased fonts demo ( v2;
knows about styles and is somewhat faster without the plugin )
Ned Konz
ned at squeakland.org
Tue Mar 23 00:59:50 UTC 2004
I have updated the FT2 font demo.
I put another quick demo of the Freetype/2 font rendering up at:
http://bike-nomad.com/squeak/FT2FontDemo2-nk.sar
This SAR contains pre-rendered versions of the BitstreamVera family, along
with the FT2Font class and the BitBlt and other changes required to display
these fonts (with or without the enhanced BitBlt plugin, but since I'm the
only one right now with a copy of that plugin that doesn't matter).
I have fixed the truncated character bottoms and the lack of understanding of
emphasis.
It should work in a recent (3.7a) Squeak image; I have only tried it in a 5816
image.
Arjen van Elteren wrote the original plugin and font code; I have modified it
to understand style changes (bold, italic, etc.) and to render properly in
the absence of the enhanced BitBlt modes that were provided by his plugins.
There is also a plugin that speeds up drawing (which works under Linux right
now), and a plugin that interfaces with the Freetype/2 libraries. I will be
putting the code for all of these things (along with the demo install SAR) on
SqueakMap.
You might find it interesting to compare them to their TTCFont equivalents.
See the attached image.
I find them quite usable. They don't have the arrows re-mapped; I could do
this easily if there is enough demand (the glyphs are (I believe) in the
original fonts)). I believe that the demo has characters in the Latin1
mapping, rather than MacRoman (I can fix this easily, but wanted to get a
sample out).
Currently, the design of the FT2Font is very similar to the design of the
StrikeFont: the character glyphs (corresponding to characters whose values
are between 0 and 255) are stored in a single Form.
So to use these for extended character sets would require a bit of tinkering.
However, the FT2 library interface is quite capable of working together with
something like TTCFont and producing better antialiased results.
The font interface in Squeak should be unified; there is quite a bit of
overlap.
The BitBlt changes could also benefit TTCFonts which are rendered in a single
color. Right now we're caching 32-bit forms rendered in a single color. Using
this 8-bit deep encoding would mean that we could save at least 75% of the
memory, and more whenever we're rendering the same glyphs in different
colors.
I will be moving Arjen's BitBlt changes out of mode 34 and into a new mode
(38?) soon.
For reference, I'm using the auto-hinting in Freetype/2 (that is, my version
is compiled without the patent-encumbered interpreter).
--
Ned Konz
http://bike-nomad.com/squeak/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FT2vsTTCFont.png
Type: image/png
Size: 10913 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040322/68506496/FT2vsTTCFont.png
More information about the Squeak-dev
mailing list
|