Reputation: 1507
I'm in the process of vectorizing true type fonts to render them as Direct3D primitives. So far I've successfully managed to extract the glyphs using GetGlyphOutline, and render them as linelist primitives. Anyway, on to the spacing...
How can I find out the spacing between characters, or how/where is it determined? Clearly the spaces vary with non-monospace fonts.
Is there a GDI+ or other windows function call to determine the spacing?
Upvotes: 0
Views: 2216
Reputation: 2409
You are referring to the advance width of the glyphs (stored in the hmtx table of the font, or vmtx for vertical text). Via GDI, which it sounds like you are using rather than DirectWrite, you can use:
Kerning is an additional optional adjustment to the nominal advance, such as in the word "AVATAR" where 'A' and 'V' would be shifter closer for aesthetic purposes.
Upvotes: 2
Reputation: 175748
I don't know anything about direct3d, but if your just after the metrics they are stored in the typefaces kerning table; GetKerningPairs will tell you the correct placement for sets of character pairs.
Upvotes: 1