[HarfBuzz] Valid range of deltaGlyphID is too small

Dohyun Kim nomosnomos at gmail.com
Tue Sep 27 03:04:11 PDT 2011


While testing harfbuzz-ng with a huge font which has more than 64,000
glyphs, I encountered a strange result of hb-shape:


As shown, minus GID numbers are printed on the screen; this of course
is not valid.

The problem seems to occur because of the valid range of deltaGlyphID
in hb-ot-layout-gsub-table.hh.
After having changed 67th line of hb-ot-layout-gsub-table.hh from

  SHORT         deltaGlyphID;           /* Add to original GlyphID to get


  USHORT        deltaGlyphID;           /* Add to original GlyphID to get

the problem disappeared and correct glyph names were printed instead
of minus GIDs.

I have no idea about whether USHORT typecast is good for this case.
Anyway, changing to USHORT has solved an issue which has nagged me for months.

Dohyun Kim
College of Law, Dongguk University
Seoul, Republic of Korea

More information about the HarfBuzz mailing list