SDL_ttf++
C++wrapperfortheSDL_ttflibrary.

sdl::ttf::Font Struct Reference

Represents a font. More...

#include <Font.h>

List of all members.

Public Member Functions

 Font (const string &filename, int pointSize)
 ~Font ()
template<int Encoding, class RenderMode >
Surface render (const string &text, const RenderMode &mode) const
template<int Encoding>
void size (const string &text, int *height, int *width) const
Glyph glyph (char c) const
TTF_Font * operator* () const
int height () const
int ascent () const
int descent () const
int lineSkip () const
int getStyle ()
void setStyle (int style)

Detailed Description

Represents a font.

Definition at line 46 of file Font.h.


Constructor & Destructor Documentation

sdl::ttf::Font::Font ( const string &  filename,
int  pointSize 
) [inline]

Constructs a font, with the given point size, from a file.

Definition at line 50 of file Font.h.

sdl::ttf::Font::~Font ( ) [inline]

Destroys the Font.

Definition at line 59 of file Font.h.


Member Function Documentation

int sdl::ttf::Font::ascent ( ) const [inline]

Returns the maximum pixel ascent of all Glyphs of the font.

Returns:
The maximum pixel ascent.

Definition at line 119 of file Font.h.

int sdl::ttf::Font::descent ( ) const [inline]

Returns the maximum pixel descent of all Glyphs of the font.

Returns:
The maximum pixel descent.

Definition at line 126 of file Font.h.

int sdl::ttf::Font::getStyle ( ) [inline]

Gets the font's style.

Returns:
The style.

Definition at line 140 of file Font.h.

Glyph sdl::ttf::Font::glyph ( char  c) const [inline]

Returns a Glyph of c.

Parameters:
cThe character to render.
Returns:
A Glyph containing the character.

Definition at line 98 of file Font.h.

int sdl::ttf::Font::height ( ) const [inline]

Returns the font height.

Returns:
The height.

Definition at line 112 of file Font.h.

int sdl::ttf::Font::lineSkip ( ) const [inline]

Returns the recommended pixel height of a line of text for the font.

Returns:
The recommended line height.

Definition at line 133 of file Font.h.

TTF_Font* sdl::ttf::Font::operator* ( ) const [inline]

Returns the underlying TTF_Font structure.

Returns:
The underlying TTF_Font structure.

Definition at line 105 of file Font.h.

template<int Encoding, class RenderMode >
Surface sdl::ttf::Font::render ( const string &  text,
const RenderMode &  mode 
) const [inline]

Returns a Surface containg the text rendered in the render mode.

Template Parameters:
EncodingThe string encoding.
RenderModeThe mode to use in rendering.
Parameters:
textThe string to render.
modeThe mode to use in rendering.
Returns:
The rendered Surface.

Definition at line 73 of file Font.h.

void sdl::ttf::Font::setStyle ( int  style) [inline]

Sets the fon't style.

Parameters:
styleThe style.

Definition at line 147 of file Font.h.

void sdl::ttf::Font::size< UNICODE > ( const string &  text,
int *  height,
int *  width 
) const [inline]

Returns the size of the text as it would be rendered.

Template Parameters:
EncodingThe string encoding.
Parameters:
textThe text.
heightThe rendered height.
widthThe rendered width.

Definition at line 87 of file Font.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Enumerations Enumerator