Question about GPOS, GSUB

Wei HuangWei Huang Posts: 88
edited March 2015 in Technique and Theory
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:
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 shift
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
I still don't quite understand Werner's advice but from what I understand I think it means this:

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?
Tagged:

Comments

  • Wei HuangWei Huang Posts: 88
    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 :-)

Sign In or Register to comment.