문제

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!

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top