Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members
OGLFT::Grayscale Class Reference
Render text as a grayscale raster image.
More...
#include <OGLFT.h>
Inheritance diagram for OGLFT::Grayscale::
List of all members.
Public Methods |
| Grayscale (const char *filename, float point_size=12, FT_UInt resolution=100) |
| Grayscale (FT_Face face, float point_size=12, FT_UInt resolution=100) |
| ~Grayscale (void) |
Detailed Description
Render text as a grayscale raster image.
The Grayscale style is similar to the Monochrome style. FreeType is used to rasterize a glyph and this is then drawn on the screen using glDrawPixels
. The FreeType rasterization is done in anti-aliased mode. When Grayscale draws the glyph image, the resulting text is blended smoothly from the foreground color to the background color. The background of the glyph is opaque, so this style works best over a solid background.
Note: you must call
glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
before drawing in order for grayscale glyphs to be rendered properly.
Another note: It is helpful to have the option GL_RASTER_POSITION_UNCLIPPED_IBM
available if you intend to draw text at MODELVIEW based positions, otherwise if the initial text position is off the screen, the entire image is clipped.
Constructor & Destructor Documentation
OGLFT::Grayscale::Grayscale (
|
const char * filename,
|
|
float point_size = 12,
|
|
FT_UInt resolution = 100 )
|
|
|
-
Parameters:
-
file
|
the filename which contains the font face. |
point_size
|
the initial point size of the font to generate. A point is essentially 1/72th of an inch. Defaults to 12. |
resolution
|
the pixel density of the display in dots per inch (DPI). Defaults to 100 DPI. |
|
OGLFT::Grayscale::Grayscale (
|
FT_Face face,
|
|
float point_size = 12,
|
|
FT_UInt resolution = 100 )
|
|
|
-
Parameters:
-
face
|
open FreeType FT_Face. |
point_size
|
the initial point size of the font to generate. A point is essentially 1/72th of an inch. Defaults to 12. |
resolution
|
the pixel density of the display in dots per inch (DPI). Defaults to 100 DPI. |
|
OGLFT::Grayscale::~Grayscale (
|
void )
|
|
|
The destructor doesn't do anything in particular. |
The documentation for this class was generated from the following files:
Generated at Fri Jul 12 10:47:15 2002 for OGLFT by
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001