| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/text/fontdefinition.h>

Public Member Functions | |
| FontDefinition (const std::string &name, const std::string &fontfile, const std::string &style, SO< FontSize > size, unsigned int typeFlags) | |
| Constructors. | |
| virtual | ~FontDefinition () |
| Destructor. | |
| const std::string & | getName () const |
| Returns the unique name of this FontDefinition ( for example 'Times 8pt bold' ). | |
| const std::string & | getFont () const |
| Returns the fonts filename ( for example 'times.ttf' ). | |
| const std::string & | getStyle () const |
| Returns the style of this font ( for example 'bold' ). | |
| const SO< FontSize > | getSize () const |
| Returns the font-size. | |
| float | getLineHeight () const |
| Returns the line-height. | |
| bool | hasVerticalMetrics () const |
| Returns true if the Font contains Metrics for Vertical Text. | |
| bool | hasHorizontalMetrics () const |
| Returns true if the Font contains Metrics for Horizontal Text. | |
| float | getAscender () const |
| MiddleLine to Top. | |
| float | getDescender () const |
| MiddleLine to Bottom. | |
| unsigned int | getTextureSize () const |
| The TextureSize. | |
| unsigned int | getPixelPerEmY () const |
| unsigned int | getPixelPerEmX () const |
| std::string | toString () const |
| Returns a String description of this FontDefinition for debugging purpose. | |
| void | loadFontFace () |
| Loads the font-file and searches for the defined style and size. | |
| SO< FontDefinition > | getFallBackFont () const |
| The fallback FontDef to be used when a Glyph is not found in this FontDefinition. | |
| void | setFallBackFont (SO< FontDefinition > fontdef) |
| Sets the fallback FontDef to be used when a Glyph is not found in this FontDefinition. | |
| SO< FontTexture > | getFontTexture (unsigned int id) const |
| Returns the FontTexture for the given ID. | |
| void | addGlyphs (GlyphCharcode *charArray, unsigned int count) |
| Adds all glyph, found by the charcodes specified in charArray, to this FontDefinition. | |
| void | addGlyphs (const std::string &str) |
| Adds all glyph, found by the charcodes specified in str, to this FontDefinition. | |
| void | addGlyphs (const char *str, int count) |
| Adds all glyph, found by the charcodes specified in str, to this FontDefinition. | |
| void | addGlyphs (std::vector< GlyphCharcode > charVec) |
| Adds all glyph, found by the charcodes specified in charVec to this FontDefinition. | |
| void | addGlyphs (SO< Array< GlyphCharcode > > charArr) |
| Adds all glyph, found by the charcodes specified in charArr to this FontDefinition. | |
| void | addDefaultGlyphs () |
| Adds a number of default glyphs (ASCII 33 to ASCII 126) to this FontDefinition. | |
| bool | hasGlyphForChar (GlyphCharcode cha) const |
| Checks if a glyph exists within is this Font. | |
| bool | isGlyphForCharLoaded (GlyphCharcode cha) const |
| Checks if a glyph is loaded. | |
| SO< FontGlyph > | getGlyphForCharcode (GlyphCharcode cha) |
| Returns the glyph for a character if it has been loaded If not loaded the char will be added. | |
| void | injectFontGlyph (GlyphCharcode cha, SO< FontGlyph > fg) |
| Injects a single Glyph as a replacement for a existing for this charcode. | |
| SO< FontGlyph > | getInjectedFontGlyph (GlyphCharcode cha) |
| Returns the injected FontGlyph for this charcode, if available. | |
| void | removeInjectedFontGlyph (GlyphCharcode cha) |
| Removes the injected FontGlyph for this charcode, if available. | |
| void | clearInjectedFontGlyphs () |
| Removes all injected FontGlyphs. | |
| SO< FontGlyph > | addGlyphForChar (GlyphCharcode cha) |
| Adds a Glyph for a character. | |
| SO< FontGlyph > | addGlyph (unsigned int glyph_index, GlyphCharcode cha=0) |
| Adds a glyph for the exact index in this font-file. | |
| void | setOutline (float bordersize, SO< FontDefinition > useMetrics=NULL) |
| Adds an outline to the Font. | |
| SO< FontDefinition > | getUseMetrics () const |
| Returns the fontdefinition whose metrics should be used, for matching Fonts or NULL if none was set . | |
| void | applyImageManipulation (SO< ImageManipulator > imageman, unsigned int times=1) |
| Applies the given ImageManipulator the number of times given to all textures. | |
| unsigned int | getGlpyhSpacing () const |
| Returns the spacing between Glyphs on all generated Font-Textures. | |
| void | setGlpyhSpacing (unsigned int spacing) |
| Sets the spacing between Glyphs on all generated Font-Textures, in pixel. | |
| void | setExtraGlpyhBorder (unsigned int border) |
| Sets the extra border around all Glyphs which will be used for the uv coordinates. | |
| unsigned int | getGlyphRepresentationTypes () const |
| Returns Types of Glyphs which are be generated. | |
| VRS_TYPEINFO (FontDefinition, SharedObj) | |
| VRS_SERIALIZABLE (FontDefinition) | |
Has a unique name and contains size, fontfile and style. Contains a number of FontTextures on which different glyphs can be rendered.
| VRS::TEXT::FontDefinition::FontDefinition | ( | const std::string & | name, | |
| const std::string & | fontfile, | |||
| const std::string & | style, | |||
| SO< FontSize > | size, | |||
| unsigned int | typeFlags | |||
| ) |
Constructors.
| virtual VRS::TEXT::FontDefinition::~FontDefinition | ( | ) | [virtual] |
Destructor.
| const std::string& VRS::TEXT::FontDefinition::getName | ( | ) | const [inline] |
Returns the unique name of this FontDefinition ( for example 'Times 8pt bold' ).
| const std::string& VRS::TEXT::FontDefinition::getFont | ( | ) | const [inline] |
Returns the fonts filename ( for example 'times.ttf' ).
| const std::string& VRS::TEXT::FontDefinition::getStyle | ( | ) | const [inline] |
Returns the style of this font ( for example 'bold' ).
Returns the font-size.
| float VRS::TEXT::FontDefinition::getLineHeight | ( | ) | const [inline] |
Returns the line-height.
| bool VRS::TEXT::FontDefinition::hasVerticalMetrics | ( | ) | const [inline] |
| bool VRS::TEXT::FontDefinition::hasHorizontalMetrics | ( | ) | const [inline] |
| float VRS::TEXT::FontDefinition::getAscender | ( | ) | const [inline] |
MiddleLine to Top.
| float VRS::TEXT::FontDefinition::getDescender | ( | ) | const [inline] |
MiddleLine to Bottom.
| unsigned int VRS::TEXT::FontDefinition::getTextureSize | ( | ) | const [inline] |
The TextureSize.
| unsigned int VRS::TEXT::FontDefinition::getPixelPerEmY | ( | ) | const [inline] |
| unsigned int VRS::TEXT::FontDefinition::getPixelPerEmX | ( | ) | const [inline] |
| std::string VRS::TEXT::FontDefinition::toString | ( | ) | const |
Returns a String description of this FontDefinition for debugging purpose.
| void VRS::TEXT::FontDefinition::loadFontFace | ( | ) |
Loads the font-file and searches for the defined style and size.
If style is empty (''), the first found style is used (and saved). Searching for font-size only occurs in fixed size fonts.
| When | file not found/readable, style not found or size not found |
| SO<FontDefinition> VRS::TEXT::FontDefinition::getFallBackFont | ( | ) | const |
The fallback FontDef to be used when a Glyph is not found in this FontDefinition.
| void VRS::TEXT::FontDefinition::setFallBackFont | ( | SO< FontDefinition > | fontdef | ) |
Sets the fallback FontDef to be used when a Glyph is not found in this FontDefinition.
| fontdef | The FontDefinition used as a fallback |
| SO<FontTexture> VRS::TEXT::FontDefinition::getFontTexture | ( | unsigned int | id | ) | const |
Returns the FontTexture for the given ID.
| id | The id for the FontTexture |
| If | no found is defined for id |
| void VRS::TEXT::FontDefinition::addGlyphs | ( | GlyphCharcode * | charArray, | |
| unsigned int | count | |||
| ) |
Adds all glyph, found by the charcodes specified in charArray, to this FontDefinition.
Swallows exceptions occuring during rasterization gracefully.
| void VRS::TEXT::FontDefinition::addGlyphs | ( | const std::string & | str | ) |
Adds all glyph, found by the charcodes specified in str, to this FontDefinition.
Swallows exceptions occuring during rasterization gracefully. The std::string containing the characters.
| asUnicode | Searches for all multibytecharacter and converts those before adding. |
| void VRS::TEXT::FontDefinition::addGlyphs | ( | const char * | str, | |
| int | count | |||
| ) |
Adds all glyph, found by the charcodes specified in str, to this FontDefinition.
Swallows exceptions occuring during rasterization gracefully. The char* containing the characters. The number of characters in str
| asUnicode | Searches for all multibytecharacter and converts those before adding. |
| void VRS::TEXT::FontDefinition::addGlyphs | ( | std::vector< GlyphCharcode > | charVec | ) |
Adds all glyph, found by the charcodes specified in charVec to this FontDefinition.
Swallows exceptions occuring during rasterization gracefully.
| void VRS::TEXT::FontDefinition::addGlyphs | ( | SO< Array< GlyphCharcode > > | charArr | ) |
Adds all glyph, found by the charcodes specified in charArr to this FontDefinition.
Swallows exceptions occuring during rasterization gracefully.
| void VRS::TEXT::FontDefinition::addDefaultGlyphs | ( | ) |
Adds a number of default glyphs (ASCII 33 to ASCII 126) to this FontDefinition.
Swallows exceptions occuring during rasterization gracefully.
| bool VRS::TEXT::FontDefinition::hasGlyphForChar | ( | GlyphCharcode | cha | ) | const |
Checks if a glyph exists within is this Font.
| cha | The character to check for |
| If | fontfile has not been loaded |
| bool VRS::TEXT::FontDefinition::isGlyphForCharLoaded | ( | GlyphCharcode | cha | ) | const |
Checks if a glyph is loaded.
| cha | The character to check for |
| If | fontfile has not been loaded |
| SO<FontGlyph> VRS::TEXT::FontDefinition::getGlyphForCharcode | ( | GlyphCharcode | cha | ) |
Returns the glyph for a character if it has been loaded If not loaded the char will be added.
| If | fontfile has not been loaded |
| void VRS::TEXT::FontDefinition::injectFontGlyph | ( | GlyphCharcode | cha, | |
| SO< FontGlyph > | fg | |||
| ) |
| SO<FontGlyph> VRS::TEXT::FontDefinition::getInjectedFontGlyph | ( | GlyphCharcode | cha | ) |
| void VRS::TEXT::FontDefinition::removeInjectedFontGlyph | ( | GlyphCharcode | cha | ) |
| void VRS::TEXT::FontDefinition::clearInjectedFontGlyphs | ( | ) |
Removes all injected FontGlyphs.
| SO<FontGlyph> VRS::TEXT::FontDefinition::addGlyphForChar | ( | GlyphCharcode | cha | ) |
Adds a Glyph for a character.
| cha | The character |
| If | fontfile has not been loaded or rasterization failed |
| SO<FontGlyph> VRS::TEXT::FontDefinition::addGlyph | ( | unsigned int | glyph_index, | |
| GlyphCharcode | cha = 0 | |||
| ) |
Adds a glyph for the exact index in this font-file.
| glyph_index | The index | |
| cha | The character |
| If | fontfile has not been loaded or rasterization failed |
| void VRS::TEXT::FontDefinition::setOutline | ( | float | bordersize, | |
| SO< FontDefinition > | useMetrics = NULL | |||
| ) |
Adds an outline to the Font.
| bordersize | The size of the border in pixels | |
| useMetrics | A fontdefinition whose metrics should be used, for matching Fonts |
| SO<FontDefinition> VRS::TEXT::FontDefinition::getUseMetrics | ( | ) | const |
Returns the fontdefinition whose metrics should be used, for matching Fonts or NULL if none was set .
| void VRS::TEXT::FontDefinition::applyImageManipulation | ( | SO< ImageManipulator > | imageman, | |
| unsigned int | times = 1 | |||
| ) |
Applies the given ImageManipulator the number of times given to all textures.
| unsigned int VRS::TEXT::FontDefinition::getGlpyhSpacing | ( | ) | const [inline] |
Returns the spacing between Glyphs on all generated Font-Textures.
| void VRS::TEXT::FontDefinition::setGlpyhSpacing | ( | unsigned int | spacing | ) |
Sets the spacing between Glyphs on all generated Font-Textures, in pixel.
| void VRS::TEXT::FontDefinition::setExtraGlpyhBorder | ( | unsigned int | border | ) |
Sets the extra border around all Glyphs which will be used for the uv coordinates.
| unsigned int VRS::TEXT::FontDefinition::getGlyphRepresentationTypes | ( | ) | const |
Returns Types of Glyphs which are be generated.
| VRS::TEXT::FontDefinition::VRS_TYPEINFO | ( | FontDefinition | , | |
| SharedObj | ||||
| ) |
| VRS::TEXT::FontDefinition::VRS_SERIALIZABLE | ( | FontDefinition | ) |