Determining y character placement for displaying text

I am working on my own bitmap font renderer, and although I believe that I may have the correct spacing between characters, I'm not sure how I can determine the placement of the y character. For example, if the letter "a" had a y-placement of 0, then what would "*" or "," have? I used the winapi function GetCharABCWidthsFloatWto determine the spacing between characters, is there another function that I can use to determine any offset y?

I am best suited for my bitmaps, so they are not always the same size.

+5
source share
4 answers

y API (TextOut, DrawText ..), . "Ag" GetTextExtentPoint32, , , GetTextMetrics.

0

GetTextMetrics - . , , , , Y, tmAscent ( .)

- tmHeight. tmAscent - . tmDescent - .

tmAscent, (x, y) . y - , tmDescent (+ - , , , .)

, "a", "*" "j". .

0

: . , .

. , , ( , , ). , , .

, , , , .

0

:

, , - " " "" ( ). () (descender) .

http://www.freetype.org/freetype2/docs/tutorial/step2.html

, .

:

, , , , - ( , ). , .

, , . API , , , ascender/descender, origin/baseline line-height, , .


: API:

GetTextMetrics:
http://msdn.microsoft.com/en-us/library/dd144941(v=vs.85).aspx

TEXTMETRIC:
http://msdn.microsoft.com/en-us/library/dd145132(v=vs.85).aspx

tmAscent tmDescent y.

0

All Articles