#include <OpenGUI_FontSet.h>
Inheritance diagram for OpenGUI::FontSet:

Public Member Functions | |
| const std::string & | getFilename () |
| Returns the filename used to load the font. | |
| const std::string & | getName () |
| Returns the name of this font. | |
| bool | getGlyph (const char glyph_charCode, const IVector2 &pixelSize, FontGlyph &outFontGlyph) |
| Retrieves the imagery backing a font glyph, as well as a pixel based rect defining the glyph extents. | |
| unsigned int | getLineSpacing (unsigned int pointSize) |
| Returns the line height in pixels for a given pixelSizeY. | |
| int | getAscender (unsigned int pointSize) |
Returns the font wide ascender in pixels for a given pointSize. | |
| int | getDescender (unsigned int pointSize) |
Returns the font wide descender in pixels for a given pointSize. | |
| int | getMaxAdvance (unsigned int pointSize) |
Returns the maximum horizontal advance for all characters at the given pointSize. | |
| int | getTextWidth (const IVector2 &pixelSize, const std::string &text) |
Returns the true width for the given text at the given pointSize. | |
| void | renderGlyph (char glyph_charCode, const IVector2 &pixelSize, TextureDataRect *destTDR, FontGlyphMetrics &destGlyphMetrics) |
| Renders the requested glyph to the given TextureDataRect in the size specified. | |
Protected Member Functions | |
| FontSet (const std::string &sourceFilename, const std::string &fontName) | |
| Font creation implies loading of the font via FreeType. | |
| ~FontSet () | |
| Destruction also unloads the font from FreeType. | |
| virtual void | finalize () |
| This is called when the last handle to this object is destroyed. | |
| OpenGUI::FontSet::FontSet | ( | const std::string & | sourceFilename, | |
| const std::string & | fontName | |||
| ) | [protected] |
| OpenGUI::FontSet::~FontSet | ( | ) | [protected] |
Destruction also unloads the font from FreeType.
| void OpenGUI::FontSet::finalize | ( | ) | [protected, virtual] |
| int OpenGUI::FontSet::getAscender | ( | unsigned int | pointSize | ) |
Returns the font wide ascender in pixels for a given pointSize.
| int OpenGUI::FontSet::getDescender | ( | unsigned int | pointSize | ) |
Returns the font wide descender in pixels for a given pointSize.
| const std::string& OpenGUI::FontSet::getFilename | ( | ) | [inline] |
Returns the filename used to load the font.
| bool OpenGUI::FontSet::getGlyph | ( | const char | glyph_charCode, | |
| const IVector2 & | pixelSize, | |||
| FontGlyph & | outFontGlyph | |||
| ) |
Retrieves the imagery backing a font glyph, as well as a pixel based rect defining the glyph extents.
true on success, false if the glyph cannot be generated because of some FreeType error | glyph_charCode | The character code (currently ASCII) of the glyph you are requesting | |
| pixelSize | The size of the glyph you'd like, in pixels. Translation to/from pixels is up to the user. (See: Screen::getPPU(), Screen::getUPI()) | |
| outFontGlyph | On success, this is initialized with information about the glyph. |
outImageryPtr will provide pixel alignment if the glyph is drawn to the screen in the exact size as outPixelRect. It is up to the user to provide this last stage pixel alignment. In most cases, users should use the PrimitiveText object to generate their text output, as it will perform the necessary steps to provide pixel alignment.
| unsigned int OpenGUI::FontSet::getLineSpacing | ( | unsigned int | pointSize | ) |
Returns the line height in pixels for a given pixelSizeY.
| int OpenGUI::FontSet::getMaxAdvance | ( | unsigned int | pointSize | ) |
Returns the maximum horizontal advance for all characters at the given pointSize.
| const std::string& OpenGUI::FontSet::getName | ( | ) | [inline] |
Returns the name of this font.
| int OpenGUI::FontSet::getTextWidth | ( | const IVector2 & | pixelSize, | |
| const std::string & | text | |||
| ) |
Returns the true width for the given text at the given pointSize.
| void OpenGUI::FontSet::renderGlyph | ( | char | glyph_charCode, | |
| const IVector2 & | pixelSize, | |||
| TextureDataRect * | destTDR, | |||
| FontGlyphMetrics & | destGlyphMetrics | |||
| ) |
Renders the requested glyph to the given TextureDataRect in the size specified.
destGlyphMetrics will contain the glyph metrics in pixels for the glyph at the requested size