views:

474

answers:

2

Hi!

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

+2  A: 

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

Seva Alekseyev
thank you very much!
Jack
+1  A: 

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

Mark Ransom
do you know the same function in C#?
Jack
P/Invoke is your friend.
Seva Alekseyev