1
#include "FTPolyGlyph.h"
2
#include "FTVectoriser.h"
5
FTPolyGlyph::FTPolyGlyph( FT_GlyphSlot glyph)
9
if( ft_glyph_format_outline != glyph->format)
11
err = 0x14; // Invalid_Outline
15
FTVectoriser vectoriser( glyph);
17
if(( vectoriser.ContourCount() < 1) || ( vectoriser.PointCount() < 3))
22
vectoriser.MakeMesh( 1.0);
24
glList = glGenLists( 1);
25
glNewList( glList, GL_COMPILE);
27
const FTMesh* mesh = vectoriser.GetMesh();
28
for( unsigned int index = 0; index < mesh->TesselationCount(); ++index)
30
const FTTesselation* subMesh = mesh->Tesselation( index);
31
unsigned int polyonType = subMesh->PolygonType();
34
for( unsigned int x = 0; x < subMesh->PointCount(); ++x)
36
glVertex3f( subMesh->Point(x).x / 64.0f,
37
subMesh->Point(x).y / 64.0f,
46
FTPolyGlyph::~FTPolyGlyph()
48
glDeleteLists( glList, 1);
52
float FTPolyGlyph::Render( const FTPoint& pen)
56
glTranslatef( pen.x, pen.y, 0);
58
glTranslatef( -pen.x, -pen.y, 0);