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 / About the Font Manager


How the Font Manager Responds to a Font Request

The Font Manager returns the needed information to QuickDraw in a font output record (of data type FMOutput), which is described on page 4-37. This record contains a handle to the font resource that the FMInput record requested, information on how different stylistic variations affect the display of the font's glyphs, and the scaling factors.

When the Font Manager gets a request for a font in a font input record, it attempts to find a font family resource for the requested font family by following these steps:

  1. The Font Manager checks the global variable LastFOND, which contains a handle to the last font family resource used.
  2. If the last font family resource used is not the one requested, the Font Manager checks its memory cache, in which it keeps the last 12 width tables used.
  3. If the font family resource is not in the cache, the Font Manager calls the Resource Manager GetResource function to get the resource.

If the font family resource is available, the Font Manager looks in the font family resource for the ID of the appropriate font resource to match the request. If a font
family resource isn't available, the Font Manager follows these steps:

  1. The Font Manager looks for a 'FONT' resource, since such resources can exist without being associated with a font family resource.
  2. If it can't find a 'FONT' resource, the Font Manager looks for the application font.
  3. If it can't find the application font, the Font Manager looks for a neighborhood base font, which is the font with the lowest font ID for that script system. For fonts numbered below 16384, this is font 0. For fonts above 16384, the Font Manager
    looks for the nearest font resource that is a multiple of 512 and less than the
    specified font value.
  4. If it can't find a neighborhood font, the Font Manager gets the system font.
  5. If it can't find the system font, the Font Manager always uses Chicago 12.

When responding to a font request, the Font Manager first looks for a font family resource of the specified size. It then looks for the stylistic variation that was requested. It does this by assigning weights to the various styles (for example, a weight of 8 for italic, 4 for bold) and then choosing the font whose style weight most closely matches the weight of the requested style.

If the Font Manager cannot find the exact font style that QuickDraw has requested, it uses the closest font style that it does find for that font and QuickDraw then applies the correct style to that font. For example, if an italic version of the requested font cannot be found, the Font Manager returns the plain version of the font and QuickDraw will slant the characters as it draws them. The QuickDraw styles are given in the QuickDraw data type Style, which includes the values bold, italic, underline, outline, shadow, condense, and extend.

With the additional complication of having both outline and bitmapped fonts available, this process can sometimes produce results other than those that you expected. The Font Manager can be set to favor either outline or bitmapped fonts when both are available to meet a request, as described in "Favoring Outline or Bitmapped Fonts" on page 4-31. The following scenario is one example of how the font that is selected can be a surprise:

  1. You have specified that bitmapped fonts are to be preferred over outline fonts when both are available in a specific size.
  2. The system software on which your application is running has the bitmap font Times 12 and the outline fonts Times, Times Italic, and Times Bold.
  3. The user requests Times Bold 12.
  4. The Font Manager chooses the bitmapped version of Times 12 and QuickDraw algorithmically smears it to create the bold effect.

There's not much that you can do about such situations except to be aware that telling the Font Manager to prefer one kind of a font over another has implications beyond what you might initially expect.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996