Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

OGLFT::Polygonal Class Reference

This is the base class of the polygonal styles: outline, filled and solid. More...

#include <OGLFT.h>

Inheritance diagram for OGLFT::Polygonal:

OGLFT::Face OGLFT::Filled OGLFT::Outline OGLFT::Solid List of all members.

Public Methods

 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 QChar c)
BBox measure (const char *s)
BBox measure (const QString &format, double number)

Protected Types

typedef std::list< VertexInfo * > VertexInfoList
 Normally, we will consider a list of vertices.

typedef VertexInfoList::const_iterator VILCI
 A convenience definition of the iterator over the list of vertices.

typedef VertexInfoList::iterator VILI
 A convenience definition of the iterator over the list of vertices.


Protected Methods

void clearCaches (void)

Protected Attributes

struct {
character_rotation_
 Angle of rotation of characters relative to text orientation.

unsigned int tessellation_steps_
double delta_
double delta2_
double delta3_
double vector_scale_
FT_Outline_Funcs interface_
 Callbacks for FreeType glyph decomposition into outlines.

VertexInfo last_vertex_
VertexInfoList vertices_
bool contour_open_
ColorTesscolor_tess_
TextureTesstexture_tess_

Static Protected Attributes

const unsigned int DEFAULT_TESSELLATION_STEPS = 4

Detailed Description

This is the base class of the polygonal styles: outline, filled and solid.

In the polygonal styles, the detailed geometric outlines of the glyphs are extracted from the font file and rendered as polygons.


Constructor & Destructor Documentation

OGLFT::Polygonal::Polygonal const char *    filename,
float    point_size = 12,
FT_UInt    resolution = 100
 

Parameters:
filename  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::Polygonal::Polygonal 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::Polygonal::~Polygonal void    [virtual]
 

The Polygonal destructor doesn't do anything in particular.


Member Function Documentation

GLfloat OGLFT::Polygonal::characterRotationX void    const [inline]
 

Returns:
the character rotation in the X direction.

GLfloat OGLFT::Polygonal::characterRotationY void    const [inline]
 

Returns:
the character rotation in the Y direction.

GLfloat OGLFT::Polygonal::characterRotationZ void    const [inline, virtual]
 

Returns:
the character rotation in the Z direction.

Implements OGLFT::Face.

void OGLFT::Polygonal::clearCaches void    [protected, virtual]
 

The different styles have different caching needs (well, really only the texture style currently has more than the display list cache).

Implements OGLFT::Face.

ColorTess* OGLFT::Polygonal::colorTess void    const [inline]
 

Returns:
the color tesselation object.

double OGLFT::Polygonal::height void    const [virtual]
 

Returns:
the height (i.e., line spacing) at the current character size.

Implements OGLFT::Face.

BBox OGLFT::Polygonal::measure const QString &    format,
double    number
[inline, virtual]
 

Implement measuring a formatted number

Parameters:
format  the format string
number  to value to format
Returns:
the bounding box of the formatted number

Reimplemented from OGLFT::Face.

BBox OGLFT::Polygonal::measure const char *    s [inline, virtual]
 

Measure a string of characters. Note: currently, this merely calls Face's measure routine.

Parameters:
s  string of (latin1) characters to measure
Returns:
the bounding box of s.

Reimplemented from OGLFT::Face.

BBox OGLFT::Polygonal::measure const QChar    c [virtual]
 

Implement measuring a character in a polygonal face.

Parameters:
c  the (UNICODE) character to measure
Returns:
the bounding box of c.

Implements OGLFT::Face.

BBox OGLFT::Polygonal::measure unsigned char    c [virtual]
 

Implement measuring a character in a polygonal face.

Parameters:
c  the (latin1) character to measure
Returns:
the bounding box of c.

Implements OGLFT::Face.

void OGLFT::Polygonal::setCharacterRotationX GLfloat    character_rotation_x
 

Set the individual character rotation in the X direction.

Parameters:
character_rotation_x  angle in degrees of the X rotation.

void OGLFT::Polygonal::setCharacterRotationY GLfloat    character_rotation_y
 

Set the individual character rotation in the Y direction.

Parameters:
character_rotation_y  angle in degrees of the Y rotation.

void OGLFT::Polygonal::setCharacterRotationZ GLfloat    character_rotation_z [virtual]
 

Set the individual character rotation in the Z direction.

Parameters:
character_rotation_z  angle in degrees of the Z rotation.

Implements OGLFT::Face.

void OGLFT::Polygonal::setColorTess ColorTess   color_tess
 

Set an optional color tesselation object. Each tesselated vertex is passed to this object, which returns a color for that position in space.

Parameters:
color_tess  the color tesselation object.

void OGLFT::Polygonal::setTessellationSteps unsigned int    tessellation_steps
 

TrueType and Type1 files describe the boundaries of glyphs with quadratic and cubic curves, respectively. Since OpenGL can only really draw straight lines, these curves have to be tessellated. The number of steps used is fixed for all glyphs in the face, but can be changed through this method. Other notes: This value is only applicable for Outline, Filled and Solid styles. Changing this value invalidates any cached display lists for glyphs in this face.

Parameters:
tessellation_steps  the number of steps to tessellate each curved segment of a glyph outline.

void OGLFT::Polygonal::setTextureTess TextureTess   texture_tess
 

Set an optional texture coordinate tesselation object. Each tessellated vertex is passed to this object, which returns texture coordinates for that position in space.

Parameters:
texture_tess  the texture coordinate tesselation object.

unsigned int OGLFT::Polygonal::tessellationSteps void    const [inline]
 

Returns:
the number of steps used to tessellate curves in the polygonal font types.

TextureTess* OGLFT::Polygonal::textureTess void    const [inline]
 

Returns:
the texture coordinate tesselation object.


Member Data Documentation

ColorTess* OGLFT::Polygonal::color_tess_ [protected]
 

The user can provide a ColorTess object which computes a color for each tesselated vertex.

bool OGLFT::Polygonal::contour_open_ [protected]
 

As GLU tessellation proceeds, new contours open with every call to moveTo.

const unsigned int OGLFT::Polygonal::DEFAULT_TESSELLATION_STEPS = 4 [static, protected]
 

Default number of steps to break TrueType and Type1 arcs into. (Note: this looks good to me, anyway)

double OGLFT::Polygonal::delta2_ [protected]
 

When curves are tessellated, we use the forward difference algorithm from Foley and van Dam for parametric curves (pg. 511 of 2nd Ed. in C). So, the step size, delta, is in the parametric variable which is always on the interval [0,1]. Therefore, delta = 1/tessellation_steps

double OGLFT::Polygonal::delta3_ [protected]
 

When curves are tessellated, we use the forward difference algorithm from Foley and van Dam for parametric curves (pg. 511 of 2nd Ed. in C). So, the step size, delta, is in the parametric variable which is always on the interval [0,1]. Therefore, delta = 1/tessellation_steps

double OGLFT::Polygonal::delta_ [protected]
 

When curves are tessellated, we use the forward difference algorithm from Foley and van Dam for parametric curves (pg. 511 of 2nd Ed. in C). So, the step size, delta, is in the parametric variable which is always on the interval [0,1]. Therefore, delta = 1/tessellation_steps

VertexInfo OGLFT::Polygonal::last_vertex_ [protected]
 

Buffers the last control point as the outline of a glyph is decomposed.

unsigned int OGLFT::Polygonal::tessellation_steps_ [protected]
 

The tessellation of curves is pretty crude; regardless of length, use the same number of increments (and as near as I can tell, this is more than sufficient unless the glyph takes up the whole screen).

TextureTess* OGLFT::Polygonal::texture_tess_ [protected]
 

The user can provide a TextureTess object which computes texture coordinates for each tesselated vertex.

double OGLFT::Polygonal::vector_scale_ [protected]
 

For vector rendition modes, FreeType is allowed to generate the lines and arcs at the original face definition resolution. To get to the proper glyph size, the vertices are scaled before they're passed to the GLU tessellation routines.

VertexInfoList OGLFT::Polygonal::vertices_ [protected]
 

As curves are decomposed out of the glyph, their vertices are passed along to the GLU tessellation functions. These vertices have to hang around until gluTessContourEnd is called.


The documentation for this class was generated from the following files:
Generated on Wed Oct 1 10:39:03 2003 for OGLFT by doxygen1.2.18