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

Public Member Functions | |
| virtual | ~FontManager () |
| Destructor. | |
| SO< FontDefinition > | createFontDefinitionByFilename (const std::string &name, const std::string &absolutefilename, const std::string &style, SO< FontSize > size, unsigned int typeFlags=GTI_ALL, bool searchFont=true, bool usefallback=false) |
| Creates a new FontDefinition per filename. | |
| SO< FontDefinition > | createFontDefinitionByFontname (const std::string &name, const std::string &fontname, const std::string &cstyle, SO< FontSize > size, unsigned int typeFlags=GTI_ALL, bool usefallback=true) |
| Creates a new FontDefinition per fontname. | |
| void | destroyFontDefinition (const SO< FontDefinition > fd) |
| Removes an existing FontDefinition. | |
| void | destroyFontDefinitions (void) |
| Removes all existing FontDefinitionen. | |
| std::string | findFontpathPerFilename (const std::string &searchfilename, bool matchSubstring=true, bool searchDirectories=false, bool compareLowercase=true) |
| Find Font-File on system per filename. | |
| std::string | findFontpathPerFontname (const std::string &searchfontname, bool matchSubstring=true, bool searchDirectories=false, bool compareLowercase=true) |
| Find Font-File on system per fontname. | |
| void | addFontDirectory (std::string dir) |
| Adds a FontDirectory where missing Fonts may also be searched. | |
| void | removeFontDirectory (std::string dir) |
| Removes a FontDirectory, but not any loaded Fonts from this Location. | |
| void | prefetchFontDirectories (bool clearFontDirectories=true) |
| Adds all usable fonts found inside the given FontDirectories to the predefinied fonts for quicker loading, and then clears the FontDirectories. | |
| SO< FontDefinition > | getFontDefinition (const std::string &name) const |
| Gets a FontDefinition by its name. | |
| FT_Library | _getLibrary () const |
| Returns the FT Library. | |
| void | setTextureSize (unsigned int dim) |
| Sets the TextureSize. | |
| unsigned int | getTextureSize () const |
| Returns the TextureSize. | |
| void | setResolution (unsigned int horiresolution, unsigned int vertresolution) |
| Sets the Screen Resolution in DPI. | |
| unsigned int | getHoriResolution () const |
| Returns the Horizontal Screen Resolution in DPI. | |
| unsigned int | getVertResolution () const |
| Returns the Vertical Screen Resolution in DPI. | |
| GlyphCharcode | getNewLineChar () const |
| Return the character which will be used as a newline. | |
| void | setNewLineChar (GlyphCharcode gc) |
| Sets the character which will be used as a newline. | |
| void | setFallBackName (const std::string &name) |
| Sets the Fallback font file to be loaded when no Font was found. | |
| std::string | getFallBackName () const |
| Returns the Fallback font file to be loaded when no Font was found. | |
| bool | isCheckFontFileExtensions () const |
| Returns wether to check for Font-file extension ( like ttf, fon ...) or not. | |
| void | setCheckFontFileExtensions (bool check) |
| Sets wether to check for Font-file extension ( like ttf, fon ...) or not. | |
Static Public Member Functions | |
| static SO< FontManager > | getSingleton () |
| Returns the Singleton. | |
Friends | |
| void | FontDefinition::serialize (SerializationManager &doc) |
In this class FontDefinitions are created, serialized, deleted. Also several global option can be set here.
| virtual VRS::TEXT::FontManager::~FontManager | ( | ) | [virtual] |
Destructor.
| static SO<FontManager> VRS::TEXT::FontManager::getSingleton | ( | ) | [static] |
Returns the Singleton.
| SO<FontDefinition> VRS::TEXT::FontManager::createFontDefinitionByFilename | ( | const std::string & | name, | |
| const std::string & | absolutefilename, | |||
| const std::string & | style, | |||
| SO< FontSize > | size, | |||
| unsigned int | typeFlags = GTI_ALL, |
|||
| bool | searchFont = true, |
|||
| bool | usefallback = false | |||
| ) |
Creates a new FontDefinition per filename.
If the given file does not exist and searchFont is set true, the font will be searched in the font-paths. If usefallback is true, a default font will be loaded if even this fails.
| name | The unique managed name ( for example 'Times 8pt bold' ) | |
| filename | The font filename ( for example '../fonts/times.ttf' ) | |
| style | The font-style ( for example 'bold' ) | |
| size | The font-size ( for example '12px' ) |
| typeFlags | The kind of glyphs which should be generated | |
| searchFont | Should the font paths be searched | |
| usefallback | Should a system-font be used if nothing could be loaded |
| If | the creation fails or the unique name already exists |
| SO<FontDefinition> VRS::TEXT::FontManager::createFontDefinitionByFontname | ( | const std::string & | name, | |
| const std::string & | fontname, | |||
| const std::string & | cstyle, | |||
| SO< FontSize > | size, | |||
| unsigned int | typeFlags = GTI_ALL, |
|||
| bool | usefallback = true | |||
| ) |
Creates a new FontDefinition per fontname.
If the given font name is not found and usefallback is true, a default font will be tried to load.
| name | The unique managed name ( for example 'Times 8pt bold' ) | |
| fontname | The font name ( for example 'Arial' ) | |
| style | The font-style ( for example 'bold' ) | |
| size | The font-size ( for example '12px' ) |
| typeFlags | The kind of glyphs which should be generated | |
| usefallback | Should a system-font be used if nothing could be loaded |
| If | the creation fails or the unique name already exists |
| void VRS::TEXT::FontManager::destroyFontDefinition | ( | const SO< FontDefinition > | fd | ) |
| void VRS::TEXT::FontManager::destroyFontDefinitions | ( | void | ) |
Removes all existing FontDefinitionen.
| std::string VRS::TEXT::FontManager::findFontpathPerFilename | ( | const std::string & | searchfilename, | |
| bool | matchSubstring = true, |
|||
| bool | searchDirectories = false, |
|||
| bool | compareLowercase = true | |||
| ) |
Find Font-File on system per filename.
| searchfilename | The stripped name of the fontfile | |
| substring | Tries to match with a substring, if searching for Arial "Arial.ttf" will also be found. | |
| searchDirectories | Will try to find any matching filename also in user defined Font Directories | |
| compareLowercase | All comparisions will be case insensitive |
| std::string VRS::TEXT::FontManager::findFontpathPerFontname | ( | const std::string & | searchfontname, | |
| bool | matchSubstring = true, |
|||
| bool | searchDirectories = false, |
|||
| bool | compareLowercase = true | |||
| ) |
Find Font-File on system per fontname.
| searchfontname | The total name of the font | |
| substring | Tries to match with a substring, if searching for Arial "Arial Bold" will also be found. | |
| searchDirectories | Will try to find any matching filename also in user defined Font Directories | |
| compareLowercase | All comparisions will be case insensitive |
| void VRS::TEXT::FontManager::addFontDirectory | ( | std::string | dir | ) |
Adds a FontDirectory where missing Fonts may also be searched.
| void VRS::TEXT::FontManager::removeFontDirectory | ( | std::string | dir | ) |
Removes a FontDirectory, but not any loaded Fonts from this Location.
| void VRS::TEXT::FontManager::prefetchFontDirectories | ( | bool | clearFontDirectories = true |
) |
Adds all usable fonts found inside the given FontDirectories to the predefinied fonts for quicker loading, and then clears the FontDirectories.
| clearFontDirectories | Wether the directories will be removed from m_FontDirectories |
| SO<FontDefinition> VRS::TEXT::FontManager::getFontDefinition | ( | const std::string & | name | ) | const |
| FT_Library VRS::TEXT::FontManager::_getLibrary | ( | ) | const [inline] |
Returns the FT Library.
| void VRS::TEXT::FontManager::setTextureSize | ( | unsigned int | dim | ) |
Sets the TextureSize.
| dim | An unsigned integer power of two (16,32,64,128,256,512,1024,2048,4096) |
| unsigned int VRS::TEXT::FontManager::getTextureSize | ( | ) | const [inline] |
Returns the TextureSize.
| void VRS::TEXT::FontManager::setResolution | ( | unsigned int | horiresolution, | |
| unsigned int | vertresolution | |||
| ) |
Sets the Screen Resolution in DPI.
| horiresolution | Windows 96, Mac OS 72 | |
| vertresolution | Windows 96, Mac OS 72 |
| unsigned int VRS::TEXT::FontManager::getHoriResolution | ( | ) | const [inline] |
Returns the Horizontal Screen Resolution in DPI.
| unsigned int VRS::TEXT::FontManager::getVertResolution | ( | ) | const [inline] |
Returns the Vertical Screen Resolution in DPI.
| GlyphCharcode VRS::TEXT::FontManager::getNewLineChar | ( | ) | const [inline] |
Return the character which will be used as a newline.
| void VRS::TEXT::FontManager::setNewLineChar | ( | GlyphCharcode | gc | ) |
Sets the character which will be used as a newline.
| void VRS::TEXT::FontManager::setFallBackName | ( | const std::string & | name | ) |
Sets the Fallback font file to be loaded when no Font was found.
| std::string VRS::TEXT::FontManager::getFallBackName | ( | ) | const |
Returns the Fallback font file to be loaded when no Font was found.
| bool VRS::TEXT::FontManager::isCheckFontFileExtensions | ( | ) | const |
Returns wether to check for Font-file extension ( like ttf, fon ...) or not.
| void VRS::TEXT::FontManager::setCheckFontFileExtensions | ( | bool | check | ) |
Sets wether to check for Font-file extension ( like ttf, fon ...) or not.
| void FontDefinition::serialize | ( | SerializationManager & | doc | ) | [friend] |