To position glyphs correctly, it is often necessary to make use of the glyph’s metrics from within the font. Glyph metrics are numeric values for standard measurements defined for each glyph within the TrueType font. The following metrics can be used in a GDL program:
Useful abbreviations (as defined in stddef.gdh) are shown in parenthesis. Note that ascent and descent are not metrics of an individual glyph but of the font as a whole.
For this exercise use sildub3.ttf. Use shifting and/or kerning to position diacritics (such as those shown in the table below) over various base characters. The diacritics should be attached to the previous base character.
What is required to position them correctly over base characters of widely different widths and heights (eg, m vs. l)?
What is necessary to handle diacritics that have overstriking built in to their glyph metrics?
What is necessary to render i and j correctly with diacritics? (Hint: other glyphs you may find useful include: dotless i [glyphid 175] and dotless j [glyphid 217]).
To test your program, open file test_ex11.wpx, and set the font of writing system TUT11 to your font. Or install the “Graphite Tutorial” (graphite_tutorial.kmx) Keyman keyboard and use the keystrokes shown in the table below.
Hint: instead of including numbers directly in the rules, define glyph attributes indicating the amounts by which to shift. You may also need to define a glyph attribute on the base characters as well as the diacritics being positioned. To access glyph attributes for a slot in the rule other than the one being shifted, use the following syntax: