Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

PG_Font Class Reference

font description class More...

#include <pgfont.h>

List of all members.

Public Types

enum  Style { NORMAL = 0x00, BOLD = 0x01, ITALIC = 0x02, UNDERLINE = 0x04 }
 Font styles. More...

Public Member Functions

 PG_Font (const std::string &fontfile, int size=14, int index=0)
 Construct a PG_Font object.
 PG_Font (const PG_Font &font)
PG_Fontoperator= (const PG_Font &font)
virtual ~PG_Font ()
int GetFontAscender ()
int GetFontDescender ()
int GetFontHeight ()
 Get the absolute height of the font (in pixels).
void SetColor (const PG_Color &c)
 Set the color of the font.
void SetHighlightColor (const PG_Color &c)
PG_Color GetColor ()
 Get the current color of the font.
PG_Color GetHighlightColor ()
void SetAlpha (int a)
 Set the transparency of the font.
int GetAlpha ()
 Get the transparency of the font.
void SetSize (int s)
 Set the size of the font.
int GetSize ()
 Get the size of the font.
void SetStyle (Style s)
Style GetStyle ()
bool SetName (const std::string &fontfile)
 Set the name (filename) of the font.
const std::string & GetName ()
 Get the current name of the font (filename).
void SetIndex (int index)
int GetIndex ()

Friends

class PG_FontEngine


Detailed Description

font description class

This class defines the parameters of a font (size, style, ...)

Definition at line 63 of file pgfont.h.


Member Enumeration Documentation

enum PG_Font::Style
 

Font styles.

Enumeration values:
NORMAL 
BOLD 
ITALIC 
UNDERLINE 

Definition at line 67 of file pgfont.h.


Constructor & Destructor Documentation

PG_Font::PG_Font const std::string &  fontfile,
int  size = 14,
int  index = 0
 

Construct a PG_Font object.

Parameters:
fontfile name of the fontfile to load
size size of the new font
index font index of the loaded file

Definition at line 22 of file pgfont_impl.cpp.

References PG_FontDataInternal::alpha, PG_FontDataInternal::color, PG_FontDataInternal::FaceCache, PG_FontDataInternal::highlightColor, PG_FontDataInternal::index, PG_FontDataInternal::name, NORMAL, PG_LogERR(), PG_FontDataInternal::size, and PG_FontDataInternal::style.

PG_Font::PG_Font const PG_Font font  ) 
 

Definition at line 60 of file pgfont_impl.cpp.

PG_Font::~PG_Font  )  [virtual]
 

Definition at line 75 of file pgfont_impl.cpp.


Member Function Documentation

int PG_Font::GetAlpha  ) 
 

Get the transparency of the font.

Returns:
font alpha value

Definition at line 115 of file pgfont_impl.cpp.

References PG_FontDataInternal::alpha.

Referenced by PG_FontEngine::BlitFTBitmap(), and BlitTemplate().

PG_Color PG_Font::GetColor  ) 
 

Get the current color of the font.

Returns:
PG_Color class containing the current color

Definition at line 103 of file pgfont_impl.cpp.

References PG_FontDataInternal::color.

Referenced by BlitTemplate(), PG_Widget::GetFontColor(), PG_Widget::RenderText(), and PG_FontEngine::RenderText().

int PG_Font::GetFontAscender  ) 
 

Definition at line 80 of file pgfont_impl.cpp.

References PG_FontFaceCacheItem::Face, PG_FontDataInternal::FaceCache, and FT_CEIL.

Referenced by PG_Widget::GetFontAscender(), and PG_Widget::GetTextHeight().

int PG_Font::GetFontDescender  ) 
 

Definition at line 85 of file pgfont_impl.cpp.

References PG_FontFaceCacheItem::Face, PG_FontDataInternal::FaceCache, and FT_CEIL.

int PG_Font::GetFontHeight  ) 
 

Get the absolute height of the font (in pixels).

Returns:
height of the font

Definition at line 90 of file pgfont_impl.cpp.

References PG_FontFaceCacheItem::Face, PG_FontDataInternal::FaceCache, and FT_CEIL.

Referenced by PG_Widget::GetFontHeight(), and PG_Widget::GetTextSize().

PG_Color PG_Font::GetHighlightColor  ) 
 

Definition at line 107 of file pgfont_impl.cpp.

References PG_FontDataInternal::highlightColor.

Referenced by PG_Widget::GetFontHighlightColor(), and PG_Widget::RenderText().

int PG_Font::GetIndex  ) 
 

Definition at line 177 of file pgfont_impl.cpp.

References PG_FontDataInternal::index.

Referenced by SetName(), and SetSize().

const std::string & PG_Font::GetName  ) 
 

Get the current name of the font (filename).

Returns:
the filename of the font

Definition at line 144 of file pgfont_impl.cpp.

References PG_FontDataInternal::name.

Referenced by PG_Widget::SetFont(), SetName(), and SetSize().

int PG_Font::GetSize  ) 
 

Get the size of the font.

Returns:
current size of the font

Definition at line 165 of file pgfont_impl.cpp.

References PG_FontDataInternal::size.

Referenced by PG_Widget::GetFontSize(), PG_Application::LoadTheme(), PG_Widget::SetFont(), SetName(), and SetSize().

PG_Font::Style PG_Font::GetStyle  ) 
 

Definition at line 123 of file pgfont_impl.cpp.

References PG_FontDataInternal::style.

Referenced by PG_FontEngine::GetTextSize(), and PG_FontEngine::RenderText().

PG_Font & PG_Font::operator= const PG_Font font  ) 
 

Definition at line 67 of file pgfont_impl.cpp.

void PG_Font::SetAlpha int  a  ) 
 

Set the transparency of the font.

Parameters:
a font alpha value

Definition at line 111 of file pgfont_impl.cpp.

References PG_FontDataInternal::alpha.

Referenced by PG_Widget::SetFontAlpha(), and PG_Application::SetFontAlpha().

void PG_Font::SetColor const PG_Color c  ) 
 

Set the color of the font.

Parameters:
c PG_Color class of the new color

Definition at line 95 of file pgfont_impl.cpp.

References PG_FontDataInternal::color.

Referenced by PG_Widget::RenderText(), PG_Widget::SetFontColor(), and PG_Application::SetFontColor().

void PG_Font::SetHighlightColor const PG_Color c  ) 
 

Definition at line 99 of file pgfont_impl.cpp.

References PG_FontDataInternal::highlightColor.

Referenced by PG_Widget::SetFontHighlightColor().

void PG_Font::SetIndex int  index  ) 
 

Definition at line 173 of file pgfont_impl.cpp.

References PG_FontDataInternal::index.

bool PG_Font::SetName const std::string &  fontfile  ) 
 

Set the name (filename) of the font.

Parameters:
fontfile name of the new fontfile.
Returns:
true - on success This function loads a new font from a file

Definition at line 127 of file pgfont_impl.cpp.

References PG_FontDataInternal::FaceCache, GetIndex(), GetName(), GetSize(), PG_FontDataInternal::name, and PG_LogERR().

Referenced by PG_Widget::SetFontName(), and PG_Application::SetFontName().

void PG_Font::SetSize int  s  ) 
 

Set the size of the font.

Parameters:
s new font size

Definition at line 148 of file pgfont_impl.cpp.

References PG_FontDataInternal::FaceCache, GetIndex(), GetName(), GetSize(), PG_LogERR(), and PG_FontDataInternal::size.

Referenced by PG_Widget::SetFontSize(), and PG_Application::SetFontSize().

void PG_Font::SetStyle Style  s  ) 
 

Definition at line 119 of file pgfont_impl.cpp.

References PG_FontDataInternal::style.

Referenced by PG_Application::LoadTheme(), PG_Widget::SetFontStyle(), and PG_Application::SetFontStyle().


Friends And Related Function Documentation

friend class PG_FontEngine [friend]
 

Definition at line 177 of file pgfont.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:18:53 2008 for Advanced Strategic Command by  doxygen 1.4.2