by Thomas Phinney
We’re looking for some feedback from the font developer community on how you want the AFDKO/FontLab/FontMaster code syntax to work for mark attachment. Please comment! Comments received by Friday September 29th will be most likely to influence our implementation.
In OpenType fonts, mark attachment is the GPOS (glyph positioning) rule which dynamically positions diacritical marks (accents and the like) relative to base characters or other marks.
The currently available version of Adobe’s Font Development Kit for OpenType (AFDKO) does not support OpenType mark attachment. Hence, other tools based on the AFDKO, such as FontLab or DTL FontMaster, do not support it either. We’re currently implementing such support, which will in turn determine the underlying code used by such third party tools. This also means extending the syntax of the AFDKO language to represent mark attachment. However, mark attachment is complicated, and gets even more so when one makes it contextual. The best way to represent it in the same style as other AFDKO code is not entirely clear. Here’s what we’d like your feedback on.
(Special thanks to Read Roberts, AFDKO engineer, for the remainder of this post!)
[UPDATE 11 Sep 2008: See comments for latest proposal from Read]
The syntax for a mark-to-base positioning rule ( GPOS lookup Type 4) is planned to be:
position <glyph or glyph class> # The base glyph <anchor X Y> # the anchor position on the base glyph mark <mark class name>;
# define a mark class mark [ acute grave] <anchor 300 0> @TOP_MARKS; # use mark class name in a mark-to-base rule. position [a e o ] <anchor 350 400> mark @TOP_MARKS;
Adding a contextual prefix and suffix to this is not obvious, as the input glyph in a mark-to-base rule ( that is, the glyph which is matched in the current text stream when the rule is applied) is the mark class rather than the base glyph class. The way that this rule is applied is that when the current glyph matches in the mark class for a mark-to-base rule, the application looks back in the input stream for a matching base glyph. (The lookup flag may also instruct the application to skip other mark glyphs when doing so).
Some possible representations:
position <context prefix: none or more glyphs or glyph classes> <glyph or glyph class>" <anchor X Y> mark <mark glyph class name>' <context suffix: none or more glyphs or glyph classes>This option can be described as:
- Write the complete stand-alone base-to-pos position rule
- Add double-quote to the base glyph or glyph class, to show that it is NOT part of preceding context.
- Add one single quote to the mark class name, to show that this is the input that needs to match the current glyph position
- Add the contextual prefix sequence before the base glyph
- Add the contextual suffix after the mark class name