Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members
OGLFT::Translucent Class Reference
Render text as a translucent raster image.
More...
#include <OGLFT.h>
Inheritance diagram for OGLFT::Translucent::
List of all members.
Public Methods |
| Translucent (const char *filename, float point_size=12, FT_UInt resolution=100) |
| Translucent (FT_Face face, float point_size=12, FT_UInt resolution=100) |
| ~Translucent (void) |
Detailed Description
Render text as a translucent raster image.
The Translucent style is similar to the Grayscale 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 Translucent draws the glyph image, the grayscale levels provided by FreeType are used as Alpha values in the raster image. This allows the glyphs to be smoothly blended into complicated backgrounds.
Note: you must call
glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
before drawing in order for translucent glyphs to be rendered properly. Additionally, you need to activate blending in order to achieve the translucent effect: glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
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::Translucent::Translucent (
|
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::Translucent::Translucent (
|
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::Translucent::~Translucent (
|
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:16 2002 for OGLFT by
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001