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 10 of 55

Thread: Fontmaps

Threaded View

  1. #11
    Member Regular Contributor
    Join Date
    Jan 2005
    Location
    USA
    Posts
    411
    Quote Originally Posted by Alfonse Reinheart View Post
    Why would you be surprised by that? Do you know how hard full-fledged Unicode text layout is? I know of exactly two open-source libraries that can do Unicode text layout: ICU and Pango. Both of these libraries are designed to care as little as possible about how you actually render the glyphs.

    Drawing some glyphs with OpenGL is easy. Drawing the right glyphs in the right place with any graphics API is the tricky part.
    Well I will accept that as an answer. It's not something I've looked into, but for the record this is built into Windows. Look into DrawText. The easiest thing to do might be to render the text with Direct3D to either an overlay window or to a neutral device context with a dynamic texture if your text is the usual sort of thing you find in a video game.

    That reminds me though that you can also use DrawText (or a related API; as I recall) in a way that does not actually display text, and then query the text that it would have drawn, so that effectively you end up with the Unicode layouts that you would find in the likes of Internet Explorer. You would just need to capture and render the glyphs somehow.

    EDITED: I think that might be what you are supposed to do with wglUseFontOutlines and wglUseFontBitmaps (depending on the kind of font you have etc) but these are documented to rely on display lists, and I don't know how good those are anymore. I think the concept should be added to WebGL (due to the runtime limitations of JavaScript) but otherwise that is probably not the right way. It might be a good step for generating a font texture by whatever terms OpenGL uses for render target textures

    EDITED: It's too bad those APIs do not expose the texture that the display lists would have used because that might save you the trouble of drawing the display lists to a render target.
    Last edited by michagl; 09-25-2012 at 08:05 PM.
    God have mercy on the soul that wanted hard decimal points and pure ctor conversion in GLSL.

Tags for this Thread

Posting Permissions

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