I have been working on my own bitmap font renderer and while I believe I may have the character spacing correctly, I am not sure how I can determine the the y placement of the character. For example, if the letter 'a' had a y placement of 0, then what would '*' or ',' have? I have been using the winapi function GetCharABCWidthsFloatW
to determine the spacing between characters, is there another function I can use to determine some sort of a y offset?
I am doing a best fit on my bitmap images, so they are not always the same size.
Each character itself should be offset in y-direction by the text rendering APIs correctly (
TextOut
,DrawText
, etc), so you should have a constant offset. I always get the metrics of the string "Ag" usingGetTextExtentPoint32
to obtain the metrics in general, in addition you could try GetTextMetrics.