Question

I have a library that extracts the text geometry from a truetype font file.

I use a call to CreateFont to get hold of the glyph indices and then I read the bytestream to get the point data.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd183499(v=vs.85).aspx

The issue is that if I pass true in the underline argument, The geometry does not contain the underline. Is there something specific that needs to be done??

The doc reads: fdwUnderline [in] Specifies an underlined font if set to TRUE.

This will help a lot!

Était-ce utile?

La solution

Truetype fonts don't have separate underlined variants. For example, when you select underlined Arial, Windows uses regular Arial and draws a line under it. If you read the geometry from a ttf file you get the geometry without an underline, because that's what the file contains.

If you want the "as drawn" geometry, select an outline font and call BeginPath, TextOut, EndPath and GetPath.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top