Question

Does anyone knows how to extract the characters image from a font(ttf) file?

Was it helpful?

Solution

TTF is a vector format, so there are no characters shapes, really. Load the font, select it into a device context (a memory one), render a character, grab a bitmap.

Relevant APIs: AddFontResource, CreateFont, CreateDC, CreateBitmap, SelectObject, TextOut (or DrawText).

OTHER TIPS

You can use GetGlyphOutline with GGO_BEZIER to get the shape of a single character.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top