Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 4 - Font Manager / Font Manager Reference
Routines / Handling Fonts in Memory


SetFontLock

The SetFontLock 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 the lockFlag parameter to TRUE, the SetFontLock procedure makes the most recently used font resource unpurgeable, and reads it into memory if it isn't already there. If you set the lockFlag parameter to FALSE, the SetFontLock procedure releases the memory occupied by the most recently used font by calling the ReleaseResource 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 call FMSwapFont, 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 call FMSwapFont immediately before calling SetFontLock.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro for the SetFontLock procedure is
Trap macro
_SetFontLock

SEE ALSO
The ReleaseResource procedure is described in the chapter "Resource Manager" in Inside Macintosh: More Macintosh Toolbox.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996