ADC Home > Reference Library > Technical Notes > Legacy Documents > Mac OS 9 & Earlier >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
|
RealFont causes system heap to growWhen we launch our Macintosh application, the system heap grows by huge amounts. It seems to be filling up with font-related resources. What's causing this to happen? ___
Your application is probably calling
When you call
So the system is loading every Embedding fonts in applicationsDate Written: 2/3/93 Last reviewed: 7/2/93
We're planning to distribute a custom font with our application, by including
the
There are things you must be aware of when embedding fonts in applications.
First, no ID conflict resolution is done. Since the system caches some fonts
for performance reasons, if your font has the ID of a font in the system, you
can't predict whether you'll get your font or the system's font. Second, you
must use While most printer drivers and the system take pains to find fonts wherever they may be, some software components don't, and we can't promise this will work with all printers or all software. While installing fonts in an application should work for most purposes, it's preferable all around for you (and your customers) to install your fonts in the system. Of course, you should always ask for your font by name in your code. Macintosh fonts that are likely to be availableDate Written: 2/3/93 Last reviewed: 5/4/93 Starting with system software version 6.0.5, are there certain fonts that are guaranteed available regardless of the language system running? I'm hoping that Geneva 9, Geneva 12, and Chicago 12 will always be available for my cdev. ___There's no such thing as a guaranteed font. Since fonts are simply resources in the System file or in the Fonts folder, users can remove or replace them with different ones if they're sufficiently determined to. Apple makes no guarantee that the system will work if these fonts are removed; nevertheless, their removal is possible.
There are resources in the System file that tell both Font/DA Mover and the
System 7 Finder not to show specific fonts so the users can't easily remove
them without a resource editor. Font/DA Mover's resource is of type So you have a pretty decent chance that these four fonts are available. Even if they're not, though, you'll get some font, so that text will draw even if it doesn't fit in the space you've provided. Be careful about extremely tight text spaces--it makes it a lot harder to localize your products since non-English text can expand by an average of 50 percent. Chicago Control-Q prints propeller or clover symbolDate Written: 7/4/90 Last reviewed: 6/14/93 How do I get the character that represents the clover used for Command-key equivalents in documents and in menus? ___This key is documented in the Apple Style Guide, which is available on the latest Developer CD Series disc as well as from APDA. One little feature of Key Caps which is not widely known is the Control key (not the Command or Option keys). Pressing the Control key in Chicago shows that Control-Q in Chicago maps to the propeller symbol for which you search. Control-Q generates the character code 17; the standard Macintosh character set (see Inside Macintosh Volume VI, page 12-5) specifies this symbol for it. Determining Macintosh system font sizeDate Written: 2/11/91 Last reviewed: 8/1/92 How does a program determine the default system font size? ___
If you want to know the default system font size, use the FScaleDisable and Macintosh screen renderingDate Written: 6/4/91 Last reviewed: 8/1/92
What is the current interface guideline on font scaling? Should we set
Most applications now set
With TrueType there is no issue, since Five font style-mapping table stylesDate Written: 6/17/91 Last reviewed: 6/14/93 Why is "47" the bounds of the indexes' array in the StyleTable? ___The style-mapping tables, which are used for mapping of a font style to a particular font for printing, have only five possible styles, unlike the six screen styles (underline is omitted, since a laser printer just explicitly draws a line under the string--it doesn't need a special font for that). You can have any combination of these five styles, EXCEPT that you can't have "Condense" and "Extend" at the same time (Condensed Extended wouldn't make a whole lot of sense). Thus you get (combinatorics come back to haunt us) 48 possible unique styles to map to. X-Ref: Snippet "StyleMap" on the Developer CD. LaserWriter Reference, Chapter 2, "Working with Fonts," (Addison-Wesley; APDA #M7073, $19.95). System 7 and modified fontsDate Written: 6/21/91 Last reviewed: 6/14/93
We ship modified versions of the Chicago and Geneva fonts and their What's happened is that the system software is being much more strict about whose "Chicago" it uses for menus and dialogs. The Menu and Control Managers now only look at the system file for the Chicago they use.
There are a couple of ways to get around this: First, you can try patching
A better solution is to write your own menu and control definition code--in other words, your own custom MDEF and CDEFs. The way you typically do this is to get a copy of the standard Macintosh system's MDEF or CDEF, and alter it to your specifications. In your case, this would be merely selecting your font instead of the system font. Name your font something other than Chicago and just select that font by name in the menu or control's draw routine. The Control and Menu Manager chapters in Inside Macintosh Volume I have more information on writing custom definitions. There is only one problem with this right now: While the System 6 MDEF and CDEF are available on AppleLink, the System 7 versions are not available yet, although they will be soon. A note on the use of Chicago in your application: As the June 1991 edition of the Macintosh Technical Note "Font Family Numbers" mentions, fonts are copyrighted material. Apple owns the Chicago font and typeface, so be sure you check into licensing issues before releasing any version, altered or unaltered, with your application. Spanish typographic measurementsDate Written: 12/10/91 Last reviewed: 8/1/92 What typographical measurement issues must be considered for Spanish systems? Do the Spanish specify type in ciceros and didots instead of points? ___If typesetting is done in Spain with computers, U.S. standards generally are used. It is only when typesetting is done the old-fashioned way that you'll see different measurements.
Paper sizes are different. In Spain DIN-44 (210 x 297), DIN-A3 (420 x 297) and
"folio" (215 x 315) are used. As always, you'll be working with 72 dpi for the
screen (and any time you use QuickDraw) but something different on paper, so
you'll need to use Here are the measurements used in Spain:
SetOutlinePreferred = TRUE or not?Date Written: 12/2/91 Last reviewed: 6/14/93
My application calls
Currently, the default for
TrueType fonts might be preferable even for small point sizes if linearly
scaled character widths are more important than screen rendering: if the main
purpose of a program is preprint processing for a high-resolution output
device, outlinePreferred = TRUE may give better line layout results on the
printer, at the price of "not so great" type rendering on a 72 dpi screen. (An
example of the conflict between linearly scaled TrueType and nonlinearly scaled
bitmapped fonts is Helvetica: All this boils down to the recommendation stated initially: the user should be given the flexibility to decide whether to use the existing bitmaps (using TrueType only for bigger point sizes and high-resolution printers), or to go with TrueType even if the result on the screen is not optimal. (By the way, it's likely that TrueType development will substantially reduce this conflict in the future.) FontRec fontType field and determining monospaced fontsDate Written: 1/13/92 Last reviewed: 6/14/93
How can I tell whether a font is monospaced or proportional? The
The Font Manager documentation is not explicit enough about the fact that bit
13 (0x2000) of the Getting global width table for a font specificationDate Written: 4/22/92 Last reviewed: 6/14/93
What's the fastest way to get the width table for a given font?
You probably wouldn't save much more than 1/1000th of a second if, instead of
calling The Font Manager does quite a lot of caching (up to 12 width tables), and managing the cache takes some cycles, too. If there is nothing in the cache corresponding to the font request, the cache makes the call even slower than it would be without cache.
The next source of overhead is the Resource Manager. Looking for a specific
font involves going through the whole resource chain first for the Even in case this hurdle is overcome swiftly (after all, the Resource Manager has its own caching scheme for optimization), the next step necessarily takes some time, and, as you have observed, especially on a color system: It consists of actually providing the bitmap for the font strike. If the screen depth is >1, this involves creating "synthetic" fonts for the correct screen depth, to optimize text drawing. Also, if the font is an outline font, the first time a font strike has to be rasterized is quite costly in terms of machine cycles. Finally, the width table can be created; and, because of the scaling factors involved, this requires 256 times some arithmetic which is known never to be fast enough.
All this certainly gives us an understanding for the time it takes
Depending on how predictable the usage of fonts and width tables in your
application is, you might consider building kind of a database of width tables
beforehand, or along the way, and use this information directly from within
your application. There is no shortcut at all through the Resource Manager to
get at the font resources, and there is no shortcut within SetFractEnable and recalculating width tablesDate Written: 5/5/92 Last reviewed: 6/14/93
Calling
Your observation is correct. The
In your case, you may want to keep track of the
You don't need to worry about other applications when resetting Corrupted Macintosh font or font suitcase criteriaDate Written: 6/19/92 Last reviewed: 6/14/93 How can I detect whether a font suitcase is corrupted when it's opened and whether any of the fonts in it are corrupted before any of the fonts are used? I know that the Finder is able to do this, and I was wondering whether Apple gives out this information. My program will run only under System 7, if that helps. ___The Finder and font architecture on the Macintosh are living things; the definition of what is and isn't a damaged suitcase can change from release to release of system software. However, any of the following conditions makes System 7 report the suitcase as "damaged":
We can't promise that this list is complete, but it does contain most conditions for which the Finder would report a suitcase as damaged. Downloadables
|
|