Question about GPOS, GSUB
Wei Huang
Posts: 98
I came across some problems with my hinting on subscript numerals with ttfautohint—I assumed they would look the same as the superscript numerals but weren't—I asked for Werner Lemberg's advice and it turns out it was because I was using composite glyphs in the subscript (of superscript glyphs) and I didn't turn on the option to hint composite glyphs. He also offered the following:
Use the same glyphs that are in superscript for subscript—the same position and metrics and decomposed so they are outlines. Then I edit the GPOS table using the SinglePosFormat1 table to lower the subscript glyphs (and include device tables for ppem settings). This will keep the same hinting. Is this correct? I don't understand why it's better but I'm still awaiting a response.
Furthermore: there's an example at the GPOS page "Example 2: SinglePosFormat1 Subtable" which is exactly for this situation:
In general, shifting glyphs vertically is problematic. I think a better solution than ttfautohint's `-c' option in combination with composite glyphs is to use GPOS Single Adjustments to move (non-composite) glyphs vertically, where the Adjustments' ValueRecords hold DeviceTables for vertical placement – this ensures that the shiftI still don't quite understand Werner's advice but from what I understand I think it means this:
offset is an integer number of pixels (and not in design units), thus preserving the hinted shape because GPOS positioning happens after hinting.
In the previous paragraph, I'm referring to the OpenType specification for the `GPOS' table, cf.
http://www.microsoft.com/typography/otspec/GPOS.htm#SP
http://www.microsoft.com/typography/otspec/chapter2.htm
Use the same glyphs that are in superscript for subscript—the same position and metrics and decomposed so they are outlines. Then I edit the GPOS table using the SinglePosFormat1 table to lower the subscript glyphs (and include device tables for ppem settings). This will keep the same hinting. Is this correct? I don't understand why it's better but I'm still awaiting a response.
Furthermore: there's an example at the GPOS page "Example 2: SinglePosFormat1 Subtable" which is exactly for this situation:
Example 2 uses the SinglePosFormat1 subtable to lower the Y placement of subscript glyphs in a font.Why do the subscript glyphs need to be lowered: shouldn't they be at the correct position already when designing them? Or, is it implied that subscripts are activated by a GSUB that puts the superscripts glyphs in place of the default numerals and then lowers the superscript glyphs with a GPOS?
0
Comments
-
Werner's update for those interested:
Looking closer at this issue, I have to withdraw my recommendation.
Sorry for the confusion; it simply doesn't work.[*]
The solution to the problem is *much* simpler: You have to set the
ROUND_XY_TO_GRID bit in the subscript composite glyphs! This ensures
that your glyph components are shifted by an integer pixel amount, and
doing so preserves the hinted shape. No need for ttfautohint option
`-c'.
At least this is the theory. Please test :-)0
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 803 Font Technology
- 1K Technique and Theory
- 622 Type Business
- 444 Type Design Critiques
- 542 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 485 Typography
- 303 History of Typography
- 114 Education
- 68 Resources
- 499 Announcements
- 80 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 270 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports