Versions of ZapRedraw 0.40 or greater support font handles. These
greatly simplify using the module, since all of the work of caching,
converting, loading and displaying substyles is handled for you. To use them,
first obtain a handle using ZapRedraw_FindFont, then store it in r_caddr.
From then on, this font will be used in all further screen updates. Substyles
are automatically loaded on demand, and all fonts are re-cached on a mode
change.
Font handles take the format &FFFFFFSS where FF is the font handle, and SS
are the substyle bits. The substyle bits determine the substyle used at the
start of the line, in exactly the same way as r_for and r_bac control the
colours used at the start of the line.
When you have finished with a font, call ZapRedraw_LoseFont with the handle
(the substyle bits are ignored).
Note that font data is shared, so you can, if you like, call FindFont for
each window you open, and LoseFont for each one you close, even if they all
use the same font.
|
|
|