Search code examples
textfontsdirectxrenderingtruetype

Truetype font spacing?


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?


Solution

  • 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.