libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
OGLFT::Filled Class Reference

Render text as a filled polygons. More...

#include <moOGLFT.h>

Inheritance diagram for OGLFT::Filled:
OGLFT::Polygonal OGLFT::Face OGLFT::Solid

Public Member Functions

 Filled (const char *filename, float point_size=12, FT_UInt resolution=100)
 
 Filled (FT_Face face, float point_size=12, FT_UInt resolution=100)
 
virtual ~Filled (void)
 
VertexInfoListextraVertices (void)
 
- Public Member Functions inherited from OGLFT::Polygonal
 Polygonal (const char *filename, float point_size=12, FT_UInt resolution=100)
 
 Polygonal (FT_Face face, float point_size=12, FT_UInt resolution=100)
 
virtual ~Polygonal (void)
 
void setTessellationSteps (unsigned int tessellation_steps)
 
unsigned int tessellationSteps (void) const
 
void setCharacterRotationX (GLfloat character_rotation_x)
 
void setCharacterRotationY (GLfloat character_rotation_y)
 
void setCharacterRotationZ (GLfloat character_rotation_z)
 
GLfloat characterRotationX (void) const
 
GLfloat characterRotationY (void) const
 
GLfloat characterRotationZ (void) const
 
void setColorTess (ColorTess *color_tess)
 
ColorTesscolorTess (void) const
 
void setTextureTess (TextureTess *texture_tess)
 
TextureTesstextureTess (void) const
 
double height (void) const
 
BBox measure (unsigned char c)
 
BBox measure (const char *s)
 
- Public Member Functions inherited from OGLFT::Face
 Face (const char *filename, float point_size=12, FT_UInt resolution=100)
 
 Face (FT_Face face, float point_size=12, FT_UInt resolution=100)
 
virtual ~Face (void)
 
bool isValid (void) const
 
bool addAuxiliaryFace (const char *filename)
 
bool addAuxiliaryFace (FT_Face face)
 
void setCompileMode (enum GlyphCompileMode compile_mode)
 
enum GlyphCompileMode compileMode (void) const
 
void setPointSize (float point_size)
 
float pointSize (void)
 
void setResolution (FT_UInt resolution)
 
FT_UInt resolution (void)
 
void setAdvance (bool advance)
 
bool advance (void) const
 
void setForegroundColor (GLfloat red=0.0, GLfloat green=0.0, GLfloat blue=0.0, GLfloat alpha=1.0)
 
void setForegroundColor (const GLfloat foreground_color[4])
 
GLfloat foregroundRed (void) const
 
GLfloat foregroundGreen (void) const
 
GLfloat foregroundBlue (void) const
 
GLfloat foregroundAlpha (void) const
 
void setBackgroundColor (GLfloat red=1.0, GLfloat green=1.0, GLfloat blue=1.0, GLfloat alpha=0.0)
 
void setBackgroundColor (const GLfloat background_color[4])
 
GLfloat backgroundRed (void) const
 
GLfloat backgroundGreen (void) const
 
GLfloat backgroundBlue (void) const
 
GLfloat backgroundAlpha (void) const
 
void setCharacterRotationReference (unsigned char c)
 
void setStringRotation (GLfloat string_rotation)
 
GLfloat stringRotation (void) const
 
void setHorizontalJustification (enum HorizontalJustification horizontal_justification)
 
enum HorizontalJustification horizontalJustification (void) const
 
void setVerticalJustification (enum VerticalJustification vertical_justification)
 
enum VerticalJustification verticaljustification (void) const
 
void setCharacterDisplayLists (const DisplayLists &character_display_lists)
 
DisplayListscharacterDisplayLists (void)
 
virtual BBox measureRaw (const char *s)
 
GLuint compile (const char *s)
 
GLuint compile (unsigned char c)
 
void draw (const char *s)
 
void draw (unsigned char c)
 
void draw (GLfloat x, GLfloat y, unsigned char c)
 
void draw (GLfloat x, GLfloat y, GLfloat z, unsigned char c)
 
void draw (GLfloat x, GLfloat y, const char *s)
 
void draw (GLfloat x, GLfloat y, GLfloat z, const char *s)
 
int ascender (void)
 
int descender (void)
 

Protected Member Functions

void renderGlyph (FT_Face face, FT_UInt glyph_index)
 
- Protected Member Functions inherited from OGLFT::Polygonal
void clearCaches (void)
 

Protected Attributes

GLfloat depth_offset_
 
- Protected Attributes inherited from OGLFT::Polygonal
struct {
   bool   active_
 
   GLfloat   x_
 
   GLfloat   y_
 
   GLfloat   z_
 
character_rotation_
 Angle of rotation of characters relative to text orientation. More...
 
unsigned int tessellation_steps_
 
double delta_
 
double delta2_
 
double delta3_
 
double vector_scale_
 
FT_Outline_Funcs interface_
 Callbacks for FreeType glyph decomposition into outlines. More...
 
VertexInfo last_vertex_
 
VertexInfoList vertices_
 
bool contour_open_
 
ColorTesscolor_tess_
 
TextureTesstexture_tess_
 
- Protected Attributes inherited from OGLFT::Face
std::vector< FaceData > faces_
 
bool valid_
 Did a font load OK? More...
 
enum GlyphCompileMode compile_mode_
 Glyph display list creation mode. More...
 
float point_size_
 Nominal point size. More...
 
FT_UInt resolution_
 Display resolution in pixels per inch. More...
 
bool advance_
 Does rendering text affect the MODELVIEW matrix? More...
 
GLfloat foreground_color_ [4]
 
GLfloat background_color_ [4]
 Background color (what modes would use this?) More...
 
enum HorizontalJustification horizontal_justification_
 PHIGS-like horizontal positioning of text. More...
 
enum VerticalJustification vertical_justification_
 PHIGS-like vertical positioning of text. More...
 
GLfloat string_rotation_
 Rotate an entire string in the Z plane. More...
 
FT_UInt rotation_reference_glyph_
 
FT_Face rotation_reference_face_
 The rotation reference character could be in any face. More...
 
GLfloat rotation_offset_y_
 
GlyphDLists glyph_dlists_
 Cache of defined glyph display lists. More...
 
DisplayLists character_display_lists_
 

Additional Inherited Members

- Public Types inherited from OGLFT::Face
enum  HorizontalJustification { LEFT, ORIGIN, CENTER, RIGHT }
 
enum  VerticalJustification { BOTTOM, BASELINE, MIDDLE, TOP }
 
enum  GlyphCompileMode { COMPILE, IMMEDIATE }
 
- Protected Types inherited from OGLFT::Polygonal
typedef std::list< VertexInfo * > VertexInfoList
 Normally, we will consider a list of vertices. More...
 
typedef
VertexInfoList::const_iterator 
VILCI
 A convenience definition of the iterator over the list of vertices. More...
 
typedef VertexInfoList::iterator VILI
 A convenience definition of the iterator over the list of vertices. More...
 
- Protected Types inherited from OGLFT::Face
typedef std::map< FT_UInt, GLuint > GlyphDLists
 Type of the cache of defined glyph to display list mapping. More...
 
typedef GlyphDLists::const_iterator GDLCI
 
typedef GlyphDLists::iterator GDLI
 
- Static Protected Attributes inherited from OGLFT::Polygonal
static const unsigned int DEFAULT_TESSELLATION_STEPS = 4
 

Detailed Description

Render text as a filled polygons.

filled_class.png

Each glyph is drawn as a filled polygon. The contours are extracted from the font file through FreeType. FreeType is used to scale the contours to the given size. Then the GLU tessellation routines are used to tessellate the contours into polygons (well, triangles). By default, these are drawn in GL_FILL polygon mode, but any other polygon mode can be specified.

Usually, the polygons are drawn only in the foreground color, however, you may supply ColorTess and TextureTess objects which can alter the color or texture coordinates of each vertex individually. You can also use the per-glyph display list functionality to alter the attributes of each glyph.

The only complexity to this style is selecting the point size. Since the glyphs are drawn as polygons, they are subject to the viewing and modeling transformations. The point size is nominally chosen to be the same as a raster image generated at the given resolution. Some experimentation with point size and resolution may be necessary to achieve the desired results.

Definition at line 1489 of file moOGLFT.h.

Constructor & Destructor Documentation

OGLFT::Filled::Filled ( const char *  filename,
float  point_size = 12,
FT_UInt  resolution = 100 
)
Parameters
filenamethe filename which contains the font face.
point_sizethe initial point size of the font to generate. A point is essentially 1/72th of an inch. Defaults to 12.
resolutionthe pixel density of the display in dots per inch (DPI). Defaults to 100 DPI.

Definition at line 2502 of file moOGLFT.cpp.

OGLFT::Filled::Filled ( FT_Face  face,
float  point_size = 12,
FT_UInt  resolution = 100 
)
Parameters
faceopen FreeType FT_Face.
point_sizethe initial point size of the font to generate. A point is essentially 1/72th of an inch. Defaults to 12.
resolutionthe pixel density of the display in dots per inch (DPI). Defaults to 100 DPI.

Definition at line 2510 of file moOGLFT.cpp.

OGLFT::Filled::~Filled ( void  )
virtual

The destructor deletes the GLU tessellation object allocated in in the constructor.

Definition at line 2536 of file moOGLFT.cpp.

Member Function Documentation

VertexInfoList& OGLFT::Filled::extraVertices ( void  )
inline
Returns
the list of extra vertices created by the GLU tessellation combine callback.

Definition at line 1533 of file moOGLFT.h.

void OGLFT::Filled::renderGlyph ( FT_Face  face,
FT_UInt  glyph_index 
)
protectedvirtual

Each style implements its own glyph rendering routine.

Parameters
facethe FT_Face containing the glyph.
glyph_indexthe index of the glyph in face.

Implements OGLFT::Face.

Definition at line 2541 of file moOGLFT.cpp.

Member Data Documentation

GLfloat OGLFT::Filled::depth_offset_
protected

Offset the glyph in the Z direction. Solely for the Solid subclass. Until I can figure out how to shift the glyph outside the context of this class, I guess this has got to stay (but it is redundant to extrusion_.depth_)

Definition at line 1503 of file moOGLFT.h.


The documentation for this class was generated from the following files: