#5 Font modules

OpenGLContext v2.0
closed-accepted
new module (7)
3
2003-06-05
2001-08-19
No

Create font modules. Targets: bitmap + outline. It
would be nice if out lines could be sent to GLE

methods:

1) wrap GLTT (see http://gltt.sf.net\) -> under GPL!
Also doesn't interface with GLE
2) Use PyFT to create own variant of GLTT. Problem
with this is that PyFT is under GPL, even though
Freetype can be used with either BSD/GPL. Also PyFT
is Freetype1 not Freetype2.
3) Wrap Freetype2 and write own python code.
4) write own C version of GLTT that uses Freetype.
5) Use python FontTools? (No rasterizer)
6) expose platform specific bitmap font capabilities
through WGL, AGL, GLX, etc. or come up with common
call.

Discussion

  • Logged In: YES
    user_id=34901

    Another possible option:
    http://oglft.sourceforge.net/ -- LGPL, (apparently) same
    basic functionality as GLTT, based on FreeType2. Claims to
    be 0.0 status, but has what looks to be fairly close to a
    completed OGLFT.CPP (haven't tested it's functionality, just
    browsed the code). Note that it's C++, not C, code. By the
    look of it, could be its own module, rather than being part
    of the base PyOpenGL module (especially given the license),
    as it's interactions are all self-contained (you pass in
    strings, booleans, etceteras, there's no arrays/callbacks).
    Has all the bells+whistles you'd want (multiple 2D and 3D
    formats, extrusions with GLE, use of truetype, etceteras).

     
  • Logged In: YES
    user_id=34901

    Another possible option:
    http://oglft.sourceforge.net/ -- LGPL, (apparently) same
    basic functionality as GLTT, based on FreeType2. Claims to
    be 0.0 status, but has what looks to be fairly close to a
    completed OGLFT.CPP (haven't tested it's functionality, just
    browsed the code). Note that it's C++, not C, code. By the
    look of it, could be its own module, rather than being part
    of the base PyOpenGL module (especially given the license),
    as it's interactions are all self-contained (you pass in
    strings, booleans, etceteras, there's no arrays/callbacks).
    Has all the bells+whistles you'd want (multiple 2D and 3D
    formats, extrusions with GLE, use of truetype, etceteras).

     
  • Logged In: YES
    user_id=34901

    Python fonttools project does a nice job of giving you the
    shells for the code, I'm playing around with making a
    run-time renderer with it. As noted, no rasteriser,
    however, so have to roll both geometry and raster-mode
    implementations.

     
    • milestone: 132167 --> OpenGLContext v2.0
    • assigned_to: twburton --> mcfletch
    • status: open --> closed-accepted
     
  • Logged In: YES
    user_id=34901

    Okay, now have the following in a fairly decent framework in
    OpenGLContext.scenegraph.text:

    fonttools -- provides outline or polygonal fonts, including
    capping and extrusion. Cross-platform, requires only
    fonttools, GL, GLU and GLE. Uses TTF files directly.
    (Note: there are trivial dependencies on OpenGLContext,
    nothing that couldn't be stripped out in a few hours if
    someone wanted to use the lib outside of OpenGLContext).
    Can extract font-names from those font-files of which it's
    made aware.

    pygame -- provides antialiased rendering of fonts into
    images, cross-platform, requires pygame and the attendant
    libraries, including SDL_ttf. Uses TTF files directly. Has
    no way to find out font-face or font-family names.

    wxPython -- provides non-antialiased rendering of fonts into
    images, cross-platform (but not cross-context), requires
    wxPython. Has access to registered system fonts and can use
    font-names instead of filenames to reference fonts, can't
    load TTF files directly.

    GLUT -- fallback provider, in case none of the others is
    available, provides non-antialiased glBitmap display of
    ASCII 7-bit characters in a small range of fonts and sizes.

    WGL -- provides polygonal fonts on Win32 (bitmap fonts are
    missing metrics)

    The image-based types are all currently doing glDrawPixels
    rendering, will likely be adding a texture-based version
    eventually as well.

    I'm marking the general request "closed", feel free to open
    more specific requests anybody.