Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Obtaining a character’s height

  1. #1
    Junior Member Regular Contributor pjcozzi's Avatar
    Join Date
    Jun 2004
    Location
    Philadelphia, PA
    Posts
    196

    Obtaining a character’s height

    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?

    Code :
        GetTextMetrics(hDC, &tm);
        GetCharABCWidthsFloat(hDC, symbolIndex, symbolIndex, &abcInfo);
     
        symbolHeight = tm.tmHeight;
        symbolWidth = (AgTInt)abcInfo.abcfB;
    Thanks in advance,
    Patrick

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2004
    Location
    South Africa
    Posts
    7

    Re: Obtaining a character’s height

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •