Gnash
0.8.11dev
|
Truetype font rasterizer/converter based on freetype library. More...
#include <FreetypeGlyphsProvider.h>
Public Member Functions | |
~FreetypeGlyphsProvider () | |
Destructor. More... | |
std::unique_ptr< SWF::ShapeRecord > | getGlyph (std::uint16_t code, float &advance) |
Return the given DisplayObject glyph as a shape DisplayObject definition in unitsPerEM() coordinates. More... | |
float | ascent () const |
Return the font's ascender in terms of its EM own square. More... | |
float | descent () const |
Return the font's descender in terms of its own EM square. More... | |
unsigned short | unitsPerEM () const |
Return the number of units of glyphs EM. More... | |
Static Public Member Functions | |
static std::unique_ptr< FreetypeGlyphsProvider > | createFace (const std::string &name, bool bold, bool italic) |
Named constructor for a face-bound rasterizer. More... | |
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.
Referenced by gnash::Font::ascent().
|
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 _, and gnash::log_error().
Referenced by gnash::Font::ftProvider().
float gnash::FreetypeGlyphsProvider::descent | ( | ) | const |
Return the font's descender in terms of its own EM square.
Referenced by gnash::Font::descent().
std::unique_ptr< SWF::ShapeRecord > gnash::FreetypeGlyphsProvider::getGlyph | ( | std::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. |
Referenced by gnash::Font::unitsPerEM().
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.
Referenced by gnash::Font::unitsPerEM().