PDA

View Full Version : Obtaining a characterís height



pjcozzi
06-03-2004, 06:08 AM
Hi,

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,
Patrick

ben harper
06-09-2004, 03:20 PM
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.