KSD_EXPORT_CLASSclass TFont
Abstract font base class.
Inheritance:
Public Methods
-
virtual void Open(const std::string& filename) = 0
- Load the font data from a file
-
virtual void Optimize(TFontAttr* List = NULL, int n = 0)
- Optimize a font for use with a particular set of font attr's.
-
virtual int GetHeight(const TFontAttr&) = 0
- Return the height of the font (in pixels) with a particular attr
-
virtual int GetAscent(const TFontAttr&) = 0
- Return the ascent of the font (in pixels) with a particular attr.
-
virtual int GetDescent(const TFontAttr&) = 0
- Return the descent of the font (in pixels) with a particular attr.
-
virtual int GetLineSkip(const TFontAttr&) = 0
- Returns the suggested space between lines (in pixels) for this font with a particular font attr
-
virtual void GetTextSize(const std::string& text, const TFontAttr&, int& width, int& height) = 0
- Gets the size of the given text with a particular font attr.
-
static TFont* LoadFont(const std::string& filename)
- Loads a concrete font object.
Public Members
-
enum Font style flags
Protected Methods
-
virtual void DrawString(SDL_Surface*, int X, int Y, const std::string& text, TRect* ClipRect, const TFontAttr& attr = DefaultFontAttr) = 0
- Does the actual string drawing.
Documentation
Abstract font base class. All 2D font types descend from this class.
- enum Font style flags
- Font style flags
- Normal
- Bold
- Italic
- Underline
- virtual void Open(const std::string& filename) = 0
- Load the font data from a file
- virtual void Optimize(TFontAttr* List = NULL, int n = 0)
- Optimize a font for use with a particular set of font attr's.
Some font implementations maintain a copy of the font in each form used
so far. Optimize destroys all but the list of fonts types supplied and creates
those that did not exist to begin with. If NULL is supplied as the list then
the font is optimize to the default.
- virtual int GetHeight(const TFontAttr&) = 0
- Return the height of the font (in pixels) with a particular attr
- virtual int GetAscent(const TFontAttr&) = 0
- Return the ascent of the font (in pixels) with a particular attr. The
acsent is the distance from the baseline to the top of the font. This
is a positive value.
- virtual int GetDescent(const TFontAttr&) = 0
- Return the descent of the font (in pixels) with a particular attr. The
descent is the distance from the the baseline to the bottom of the font.
This is a negative value.
- virtual int GetLineSkip(const TFontAttr&) = 0
- Returns the suggested space between lines (in pixels) for this font with a
particular font attr
- virtual void GetTextSize(const std::string& text, const TFontAttr&, int& width, int& height) = 0
- Gets the size of the given text with a particular font attr. The size
(in pixels) is placed in the width and height variables.
- static TFont* LoadFont(const std::string& filename)
- Loads a concrete font object. Use this function to generically
load a font file.
- virtual void DrawString(SDL_Surface*, int X, int Y, const std::string& text, TRect* ClipRect, const TFontAttr& attr = DefaultFontAttr) = 0
- Does the actual string drawing. Pass NULL as a clip rect to disable
clipping.
- Direct child classes:
- TTrueTypeFont
TBitmapFont
- Friends:
- class TCanvas
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.