Specifications
FIGURE 19.3
The dynamically produced inline image appears the same as a regular image to the end user.
We will also use TrueType fonts so that we can use anti-aliased text. The TrueType font func-
tions have their own quirks, which we’ll discuss.
The basic process is to take some text and generate a button with that text on it. The text will
be centered both horizontally and vertically on the button, and will be rendered in the largest
font size that will fit on the button.
We’ve built a front end to the button generator for testing and experimenting. This interface is
shown in Figure 19.4. (We have not included the HTML for this form here as it is very simple,
but you can find it on the CD in design_button.html.)
You could use this type of interface for a program to automatically generate Web sites. You
could also call the script we write in an inline fashion, to generate all a Web site’s buttons on-
the-fly!
Typical output from the script is shown in Figure 19.5.
Generating Images
C
HAPTER 19
19
G
ENERATING
IMAGES
411
24 7842 CH19 3/6/01 3:42 PM Page 411










