Important: The information in this document is obsolete and should not be used for new development.
SetFontLock
TheSetFontLock
procedure makes the most recently used font unpurgeable. You can use this procedure when you want a font to remain in memory for the sake of efficiency.
PROCEDURE SetFontLock (lockFlag: Boolean);
lockFlag
- Specifies whether or not the current font is considered purgeable.
DESCRIPTION
If you set thelockFlag
parameter toTRUE
, theSetFontLock
procedure makes the most recently used font resource unpurgeable, and reads it into memory if it isn't already there. If you set thelockFlag
parameter toFALSE
, theSetFontLock
procedure releases the memory occupied by the most recently used font by calling theReleaseResource
procedure.The font considered to be the most recently used is the one referenced by the font output record in low memory, which is filled in by the
FMSwapFont
function. This is often, but not always, the font in which text has most recently been drawn. Since both QuickDraw and your application program can callFMSwapFont
, you have to be careful about which font has most recently been used in a call to that function. To ensure that you are locking the font that you want to lock, explicitly callFMSwapFont
immediately before callingSetFontLock
.ASSEMBLY-LANGUAGE INFORMATION
The trap macro for theSetFontLock
procedure is
Trap macro _SetFontLock SEE ALSO
TheReleaseResource
procedure is described in the chapter "Resource Manager" in Inside Macintosh: More Macintosh Toolbox.