Pixel Font System

The Pixel Font System provides some classes for generating images of specified text. It is particularly useful for add labels to widgets and displaying changing text quickly.

Whilst it is easier enough to grab the image of #text members, these classes create pixel-based 'fonts'. These 'pixel fonts' are generated using 'maps' which describe how each character should be drawn.

Why bother with pixel fonts? In some circumstances (such as where you wish to change the text on stage rapidly, imaging pixel fonts will draw quicker than #text or even #field members (see this test). Pixel fonts are also guaranteed to be the same size on all platforms and will work regardless of the platform and then end-user's permissions on the system (unlike embedded fonts which may not work under versions of NT when the end-user doesn't have full admin permissions).


Font classes -- these are the basic scripts for generating character images. You can retrieve a character image using the mGetCharImage(Code) method. There is a mono version and an antialias version of the font class, as well as a common ancestor script.

Type class -- this script is used to generate images of strings and handles text formatting. You can retrieve the image of a string using the mGetImage(aString) method

Download these scripts here (Director MX cast) (version 3.0.6) - Last Updated 9 Dec 04

Utility / Helper Movies

Fontmaker -- put this utility movie in your Xtras folder. It is used to generate pixel-maps from installed fonts (this movie is provided by Joel Baranick - thanks!)

Fontmaker Movie Script -- for creating PixelFonts in the message window (updated 9/12/04 - can now save to vList members).

Demo Movie -- A demo movie showing the Font, Type and TextDisplay scripts in action (view Shockwave Demo)

Init Test Movie -- A test movie comparing the time taken to read the pixelFont propList into member from strings, scripts and vList members


v.306: Updated the FontMgr and Font.Class (base) to make it easier to LoadFonts (the fontMgr will now automatically detect whether it should instantiate the font using the Mono or AntiAlias classes). It also accepts vList member references.




First published 23/05/2005