Obtaining a character’s height


I’m trying to obtain the height and width information for a character so I can write it to a texture.

I am able to get the width for the character but I can’t find an API call to get the height. The only height I can find is the height for the entire font (see code).

Any suggestions?

    GetTextMetrics(hDC, &tm);
    GetCharABCWidthsFloat(hDC, symbolIndex, symbolIndex, &abcInfo);

    symbolHeight = tm.tmHeight;
    symbolWidth = (AgTInt)abcInfo.abcfB;

Thanks in advance,

Windows does not have very good font metric utilities. Use freetype instead. You must read the docs about how font metrics are defined, but it should be worth it.
If you want a textured font rendering library for opengl, then either use ftgl, or you can use mine if you want… which is in some respects better than ftgl… ask me if you need something for serious work.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.