Important: The information in this document is obsolete and should not be used for new development.
SetFontLock
TheSetFontLockprocedure 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 thelockFlagparameter toTRUE, theSetFontLockprocedure makes the most recently used font resource unpurgeable, and reads it into memory if it isn't already there. If you set thelockFlagparameter toFALSE, theSetFontLockprocedure releases the memory occupied by the most recently used font by calling theReleaseResourceprocedure.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
FMSwapFontfunction. 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 callFMSwapFontimmediately before callingSetFontLock.ASSEMBLY-LANGUAGE INFORMATION
The trap macro for theSetFontLockprocedure is
Trap macro _SetFontLock SEE ALSO
TheReleaseResourceprocedure is described in the chapter "Resource Manager" in Inside Macintosh: More Macintosh Toolbox.