New to Typophile? Accounts are free, and easy to set up.
Create an account
Typophile RSS | More Feeds
Is it possible to create classes for individual letters in Fontlab’s Metrics.txt file? And if so, what is the proper syntax?
If it's just single letters you don't need classes. Classes are like folders.
If there is nothing inside on compile it will just convert them to single lines of code.
as this is not officially documented, I'm trying to find out the answer to your questions from our developers.
Well, here is your answer:
you can create new sections of the Metrics.txt file (or best, put a copy into your user data folder first) by the following pattern:
#name of your section
names of classes as defined in the Classes panel
separated by new lines
one-line template definition using the /glyphname or \uUnicode notation, where @ is the currently active glyph and \n is the place of the line wrap
For example, if you have classes "onum1", "lnum1", "pnum1" and "tnum1" defined in your Classes panel that contain all the various figure types, you could define a Metrics.txt section as follows:
The "onum1" etc. class names here refer to what is defined in the Classes panel as "OpenType classes", without any glyphname prefix.
But you can also use names of Metric classes here (named e.g. ".A", ".O" etc., with dot as the prefix) or Kerning classes (named e.g. "_A", "_Y" etc., with underscore as the prefix).
Also note that in kerning mode, "@" stands of the currently selected kerning pair, and that in such case, for both glyphs from the kerning pair the appropriate left or right part of the template is selected. So if you have a section defined for uppercase and another section defined for smallcaps, then for kerning pairs such as /T/y.smcp the left part of the template will be shown from the #uppercase section and the right part will be shown from the #smallcaps section.
Also note that in Metrics.txt, there are some internally pre-initialized glyph classes such as "uppercase", "UPPERCASE", "LATIN_UC", "lowercase", "LOWERCASE", "LATIN_LC", "smallcaps", "SMALLCAPS", "LATIN_SC". If they are not defined in the Classes panel, a default pre-initialized definition will be used for them but if you define classes with those names in your Classes panel, that definition will be used. Of course you can also have additional class names that you add to the appropriate sections for Metrics.txt, e.g. "UC", "LC", "SC" if that is how you choose to name your classes in the Classes panel.