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?
GetCharABCWidthsFloatW
I am best suited for my bitmaps, so they are not always the same size.
y API (TextOut, DrawText ..), . "Ag" GetTextExtentPoint32, , , GetTextMetrics.
TextOut
DrawText
GetTextExtentPoint32
GetTextMetrics - . , , , , Y, tmAscent ( .)
- tmHeight. tmAscent - . tmDescent - .
tmAscent, (x, y) . y - , tmDescent (+ - , , , .)
, "a", "*" "j". .
: . , .
. , , ( , , ). , , .
, , , , .
:
, , - " " "" ( ). () (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.