Gnash
0.8.10
|
Truetype font rasterizer/converter based on freetype library. More...
#include <FreetypeGlyphsProvider.h>
Public Member Functions | |
~FreetypeGlyphsProvider () | |
Destructor. | |
std::auto_ptr< SWF::ShapeRecord > | getGlyph (boost::uint16_t code, float &advance) |
Return the given DisplayObject glyph as a shape DisplayObject definition in unitsPerEM() coordinates. | |
float | ascent () const |
Return the font's ascender in terms of its EM own square. | |
float | descent () const |
Return the font's descender in terms of its own EM square. | |
unsigned short | unitsPerEM () const |
Return the number of units of glyphs EM. | |
Static Public Member Functions | |
static std::auto_ptr < FreetypeGlyphsProvider > | createFace (const std::string &name, bool bold, bool italic) |
Named constructor for a face-bound rasterizer. |
Truetype font rasterizer/converter based on freetype library.
Instances of this class provide rasterized or vectorial glyphs for a given truetype font face.
The rasterized glyphs have a max size of 96 (TODO: make parametrizable) but I think the actual size could change between glyphs (see the 'box' parameter of getRenderedGlyph() method).
Vectorial glyphs are instances of a SWF::ShapeRecord, same class resulting from parsing of embedded fonts.
gnash::FreetypeGlyphsProvider::~FreetypeGlyphsProvider | ( | ) |
float gnash::FreetypeGlyphsProvider::ascent | ( | ) | const |
Return the font's ascender in terms of its EM own square.
References assert.
Referenced by gnash::Font::ascent().
std::auto_ptr< FreetypeGlyphsProvider > gnash::FreetypeGlyphsProvider::createFace | ( | const std::string & | name, |
bool | bold, | ||
bool | italic | ||
) | [static] |
Named constructor for a face-bound rasterizer.
name | Name of the font to get glyphs info from |
bold | Whether to use a bold version of the font |
italic | Whether to use an italic version of the font |
References _.
Referenced by gnash::Font::ftProvider().
float gnash::FreetypeGlyphsProvider::descent | ( | ) | const |
Return the font's descender in terms of its own EM square.
References assert.
Referenced by gnash::Font::descent().
std::auto_ptr< SWF::ShapeRecord > gnash::FreetypeGlyphsProvider::getGlyph | ( | boost::uint16_t | code, |
float & | advance | ||
) |
Return the given DisplayObject glyph as a shape DisplayObject definition in unitsPerEM() coordinates.
TODO: allow using a custom EM square ?
code | Character code. |
advance | Output parameter... units to advance horizontally from this glyph to the next, in unitsPerEM() units. |
unsigned short gnash::FreetypeGlyphsProvider::unitsPerEM | ( | ) | const |
Return the number of units of glyphs EM.
This is currently hard-coded to 1024, but could in future depend on actual font file being used.
References assert.
Referenced by gnash::Font::unitsPerEM().