Home |
Applying Custom Character Filters Using Custom Fonts |
Using Custom FontsUsing fonts generated with FontCapture is very simple. Every RTPEG-32 object that supports text output has a member function called SetFont(PegFont *). Therefore, after constructing an RTPEG-32 object that should use the new font, you simply call that object's SetFont function, passing a pointer to your new font. For example, assume that you told PegFontCapture to generate a new font called "MyNewFont", by typing this in the font name field of PegFontCapture. In this case, the following code fragment illustrates the process of altering the font used by a RTPEG-32 object: extern PegFont MyNewFont; PegTextButton * pButton = new PegTextButton(10, 10, 100, MESG1, "NewFont"); PButton->SetFont(&MyNewFont); Likewise, if you have overloaded a Draw() function for a window or other object, and you are drawing text on the screen, you can simply pass the pointer to your new font to any of the PegScreen text information or output functions.
|