|
|||||||||||||||
|
Introduction Traditionally, TrueType fonts have always had a limited set of accented glyphs. Now that fonts are no longer limited to 256 glyphs, it is possible to have a font that contains a much richer repertoire of accented glyphs, which allows it to be usable in many more languages than before. The process of creating these accented glyphs can be broken down into the following steps:
One example of each method will be illustrated below. Although these examples will show the accent to be above the base glyph, there are many cases where the accent will be below (ç), beside (some Romanian and Vietnamese glyphs) or inside (Hebrew) the base glyph. The principles for positioning remain the same for all accents and other uses. Anchor Method The illustrations are screen shots from RoyalT, Apple's TrueType editing tool. Shown here is a Hebrew glyph.
There are several anchor points for this base glyph, because different 'accents' are attached to several different points on this glyph. (Although in Hebrew these are linguistically not "accents", but Cantelation marks, the principle for positioning remains the same.) They are points 12, 41, 42 and 43. In addition, point 30 is used as both a contour and an anchor point. This is acceptable, but the designer must be aware that if this is done flexibility of positioning is lost, because the point cannot be moved to position the accent without distorting the contour.
This accent uses point 1 as the anchor point. This glyph is simple enough that no additional anchor point was thought to be required.
When combined, the points are renumbered. Points 41 and 45 (formerly point 1 on the accent) are positioned at the same coordinates, which positions the accent accordingly.
Notice that when the glyph is gridfit (instructions turned on), and the pixels displayed, the accent positions itself correctly, because the attachment point in the base glyph was instructed along with the rest of the contour. The TrueType instructions for glyph 118, the compound glyph, are as follows: OFFSET[1] 152 0 0 ANCHOR[] 4 41 1 These instructions break down as follows: OFFSET (get glyph) [1] (boolean: gridfit) 152 (the base glyph), with an offset (shift) of 0 in x and 0 in y. ANCHOR (attach to an anchor point) glyph 4 to point 41 of the original glyph, point 1 on the anchoring glyph. Or, to put it another way: OFFSET[boolean: gridfit] GlyphNumber Xoffset Yoffset ANCHOR[] GlyphNumber BaseGlyphAttachmentPoint AnchoredGlyphAttachmentPoint For a full description, see the "Component characters" section of the RoyalT Manual. Note that these are not true instructions; they are constructs used by RoyalT, which is the tool that was used to generate these examples. The actual TrueType code that these constructs control is described in the 'glyf' table section of the TrueType Reference Manual, . This information is most useful to programmers, however, and the RoyalT examples given here illustrate what is being done without going into excessive detail. Offset Method
The glyph in this example does not have any attachment points. Instead of an Offset and and Anchor instruction, we will be using two Offsets. One again, we have the base glyph
and an accent glyph.
These are combined with the following instructions for glyph 105: OFFSET[0] 68 0 0 OFFSET[1] 141 0 0 These instructions break down as follows: OFFSET (get glyph) [1] (boolean: gridfit) 68 (the base glyph), with an offset (shift) of 0 in x and 0 in y. OFFSET (get glyph) [1] (boolean: gridfit) 141 (the accent glyph) with an offset (shift), of 0 in x and 0 in y. Or, to put it another way: OFFSET[boolean: gridfit] GlyphNumber Xoffset Yoffset OFFSET[boolean: gridfit] GlyphNumber Xoffset Yoffset For a full description, see Component characters in the RoyalT Manual.
When gridfitting is on, the positioning looks good. In this example, the accent did not have any offset in x or y. This is partially because this font uses different glyphs for uppercase and lowercase accents. If the uppercase and lowercase glyphs were sharing accents, the designer would have to position the accent for one, and shift the glyph vertically for the other, by having a non-zero value for the Yoffset. Similarly, if the designer tries to use the same accent over two glyphs with widely different widths (such as an "i" and a "w"), it may be necessary to shift the accent horizontally to center the accent over the base glyph properly. To do this, a non-zero value would be used for the Xoffset. Either or both of these can be done at the same time. It is especially important to check the results of the offset method at all point sizes, because the accent will have a tendency to shift as it gridfits, and what looks good at one size may not look good at others. The designer will have to compromise, to try to find the best overall position that satisfies all sizes that are likely to be used. Other Uses It is also possible, when using either the anchor or offset method, to position multiple accents over a single base glyph. This can be done by using an Offset and multiple Anchor instructions, or three or more Offset instructions. This is necessary for Vietnamese, for example. Here is an example of a Hebrew glyph with two accents being anchored at the same time.
In this example, the instructions are: OFFSET[1] 152 0 0 ANCHOR[] 4 43 2 ANCHOR[] 4 42 2 The same accent is being positioned in two different places, by being attached to two different anchor points. Note that in this example, the accent's attachment point is it's lower left point, not lower right as in the earlier example. This shifts the position of the accent right. These instructions cannot tell which glyph is an "accent"
and which is not. Therefore, it is possible to use these methods for creating
other multiple-part glyphs, such as ligatures (f and f to make ff, f and
f and l to make ffl, etc.) or other special glyphs (= and / to make Using the AAT Font Tool and Slider tools The above methods work, but are tedious and time consuming. They are included here mostly to illustrate the principles of combining glyphs to make components. Apple has several other tools that make adding and editing accented glyph much easier. These tools use the Offset method. The AAT Font Tool automatically adds compound glyphs to a font, using an Add List, in which the designer specifies in list form which glyphs they wish to have combined and added to the font, along with accent positioning information. Once an Add List has been written, it can be used for any number of fonts, or edited where later changes are needed. This approach can greatly save time for the font designer. Detailed information on how to use this tool is provided in the AAT Font Tool manual. While the AAT Font Tool can do a very good job of positioning the accents all by itself, fine-tuning the positions of the accents is most easily done using an application called Slider, which allows the designer to visually position the accent(s) around the base glyphs quickly and easily, automatically revising the low-level TrueType Offset instructions, so the designer can concentrate on visual appearance and not on coding. Slider automatically keeps track of point renumbering, marking the glyph as having overlapping contours if necessary, etc. Detailed information on how to use this tool is provided in the Slider manual. Version 1.0 Arleigh Movitz Copyright©1997 by Apple Computer, Inc. |