Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Freetype font support
Last updated at 1:08 am UTC on 17 January 2006

News flash:


Downloadable version (of the font display code) complete with Bitstream Vera fonts is available from SqueakMap:
http://map1.squeakfoundation.org/sm/package/e308b3cc-24f3-4557-8db4-d71776bc8014
http://map1.squeakfoundation.org/sm/accountbyid/092daeeb-7a37-427f-8afb-66bf2db74f98/files/FT2DemoInstall5-nk.sar

Ongoing development versions can be downloaded from Ned Konz's Monticello repository at:
http://bike-nomad.com/squeak/monticello/Misc

Description:


This changeset adds a new bitblt (to blt a alpha mask) and a new plugin for loading and displaying truetype fonts. It is based on the freetype 2 library. Loading a font is very fast and I see no delays in displaying the fonts.

Uploaded Image: vera.gif

FT2.tgz

The package is bundled with two ".so" files for linux and a example truetype file (vera.ttf).
This example was known to work;

> squeak -plugins 'FT2/libs'
and in the workspace.

"Create interface and ask for a version (must be 2.0.9 or higher)"
i := FT2Interface new.
i version.

"Create a font array with fonts of different sizes"
fa := i fontArrayFromFile:'FT2/ttf/Vera.ttf' sizes: #(12 16 24 32 64).
s := StringMorph contents:'Fox etc.' font: fa last.
s color: Color blue.
s openInWorld.

"Create and install a text style, look in the appearance font dir"
i textStyleFromFile:'FT2/ttf/Vera.ttf' sizes: #(12 16 24 32 64).



Arjen van Elteren