Hi
I am trying to create software to look at TrueType fonts but I can not understand all things in the spec for glyf table perhaps because my English is no so good. Is there any where I can get help?
thank you
This Apple documentation shows the basics, in quite short sentences ;-)
Do you want to render the font data yourself as outlines? That's really hard. If you don't want to get involved into extremely low level programming, you can always use the FreeType libraries to load and rasterize (= convert from math outlines to a bitmapped image) fonts. FreeType can create a monochrome or grayscale image of any character, so all you have to do is write a function to put it up onto your display.
Ah -- okay. The Microsoft page is a little less vague on this subject.
Apparently, the number of flags should be equal to the number of points in one glyph. However, Bit 3 specifies a "repeat" of the current flag value, and the number of repeats is in the next byte in the same array. So if you have 10 points defining the glyph, its flags may be
0: some flags for pt #0
1: some flags for pt #1 + "repeat" bit set
2: a literal value "8"
3: some flags for pt #9
.. so the table only has 4 bytes but defines flags for all 10 points.
At least, that's what it sounds like. It's not really clear from this page what the difference is in "number of contours" and "number of points" -- the number of contours is specifically declared in the first table, and the number of points could be the same.
Captured from web.archive.org on 12 Jan 2015. view this capture