Package pygext :: Package gl :: Module font :: Class GLFont
[frames | no frames]

Type GLFont

object --+
         |
        GLFont

Known Subclasses:
GLBitmapFont

OpenGL wrapper for Pygame fonts

If you have a lot of text in your application, this class will help you conserve texture memory by pre-generating all visible characters in a font and reusing the same textures in each GLText shape.
Method Summary
  __init__(self, font, color, antialias, spacing)
Create a new GLFont wrapper around a Pygame Font.
  render(self, text, color)
Generate a text entity using the font.

Method Details

__init__(self, font, color=(255, 255, 255), antialias=True, spacing=0)
(Constructor)

Create a new GLFont wrapper around a Pygame Font.

font       - a pygame font object to be converted into an opengl font
           OR a (fontname, fontsize) tuple
color      - color of the rendered font (default white)
antialias  - antialias flag (default True)

Creating a font by its name will first try to load the font from current
working directory and if that fails, it looks for the font in system fonts.

NOTE: The color parameter should be considered deprecated at this point.
It's better to leave the font color white, and change the color of individual
TextEntities instead.
Overrides:
__builtin__.object.__init__

render(self, text, color=None)

Generate a text entity using the font.

text - string containing the text color - optional color argument (only works if no color was defined for the GLFont object) @return GLText shape rendered using the font

Generated by Epydoc 2.1 on Mon Jun 12 18:21:21 2006 http://epydoc.sf.net