KSD_EXPORT_CLASSclass TFontList

A class for storing font objects by name.

Public Methods

[more]void Clear()
Clears the font list, deleting all of the font objects.
[more]void Add(const std::string& Name, TFont* Font)
Add a font object with the given name
[more]TFont* GetFont(const std::string& Name)
Returns a pointer to the font object associated with the given name
[more]std::string GetFontName(TFont* Font)
Returns the name associated with the given font object.
[more]void LoadFont(const std::string& font_name, const std::string& filename)
Loads a font file into the list with the given name
[more]void LoadList(const std::string& filename)
Loads a font list config file


Documentation

A class for storing font objects by name. It allows you to make a text file containing mappings from font filenames to font names. It is possible to specify multiple font files to each font name. When loading the text file, TFontList will try each font file until one works. This is meant to allow you to provide fonts for both font systems in case a user doesn't use one of them. Here is example font conf file:

# You can make comments using the pound-sign

# the "/cd" command allows you to change the current directory for
# loading font files
/cd fontdir

arial	arial.ttf arial.png
fontname fontfile.ttf fontfile.png

ovoid Clear()
Clears the font list, deleting all of the font objects. Be sure to clear the font list before the application ends! If you don't, the font underlying font sub-systems could be shutdown before the font objects are deleted. A good place to clear the font list is in your application's Shutdown() function.

ovoid Add(const std::string& Name, TFont* Font)
Add a font object with the given name

oTFont* GetFont(const std::string& Name)
Returns a pointer to the font object associated with the given name

ostd::string GetFontName(TFont* Font)
Returns the name associated with the given font object. Returns an empty string if the font object isn't in the list.

ovoid LoadFont(const std::string& font_name, const std::string& filename)
Loads a font file into the list with the given name

ovoid LoadList(const std::string& filename)
Loads a font list config file


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.