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

PG_FontEngine Class Reference

C++ Encapsulation of the FreeType engine. More...

#include <pgfont.h>

Inheritance diagram for PG_FontEngine:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 PG_FontEngine ()
 ~PG_FontEngine ()

Static Public Member Functions

static bool RenderText (SDL_Surface *Surface, const PG_Rect &ClipRect, int BaseLineX, int BaseLineY, const PG_String &Text, PG_Font *ParamIn)
 render text onto a surface
static bool RenderText (SDL_Surface *Surface, const PG_Rect *ClipRect, int BaseLineX, int BaseLineY, const PG_String &Text, PG_Font *ParamIn)
static bool GetTextSize (const PG_String &Text, PG_Font *ParamIn, Uint16 *Width=NULL, Uint16 *Height=NULL, int *BaselineY=NULL, int *FontLineSkip=NULL, Uint16 *FontHeight=NULL, int *Ascent=NULL, int *Descent=NULL)

Static Protected Member Functions

static bool BlitFTBitmap (SDL_Surface *Surface, FT_Bitmap *Bitmap, int PosX, int PosY, PG_Font *Param, const PG_Rect *ClipRect)
static void FontEngineError (FT_Error error)

Friends

class PG_Font

Classes

class  FONT_ITEM

Detailed Description

C++ Encapsulation of the FreeType engine.

Author:
Alexander Pipelka / Ales Teska

Definition at line 186 of file pgfont.h.


Constructor & Destructor Documentation

PG_FontEngine::PG_FontEngine  ) 
 

Definition at line 41 of file pgfont.cpp.

PG_FontEngine::~PG_FontEngine  ) 
 

Definition at line 45 of file pgfont.cpp.


Member Function Documentation

bool PG_FontEngine::BlitFTBitmap SDL_Surface *  Surface,
FT_Bitmap *  Bitmap,
int  PosX,
int  PosY,
PG_Font Param,
const PG_Rect ClipRect
[static, protected]
 

Definition at line 293 of file pgfont.cpp.

References BlitTemplate(), PG_Font::GetAlpha(), and PG_LogWRN().

Referenced by RenderText().

void PG_FontEngine::FontEngineError FT_Error  error  )  [static, protected]
 

Definition at line 60 of file pgfont.cpp.

References PG_LogWRN().

bool PG_FontEngine::GetTextSize const PG_String &  Text,
PG_Font ParamIn,
Uint16 *  Width = NULL,
Uint16 *  Height = NULL,
int *  BaselineY = NULL,
int *  FontLineSkip = NULL,
Uint16 *  FontHeight = NULL,
int *  Ascent = NULL,
int *  Descent = NULL
[static]
 

Definition at line 600 of file pgfont.cpp.

References PG_GlyphCacheItem::Advance_x, PG_FontFaceCacheItem::Ascent, PG_GlyphCacheItem::Bitmap, PG_GlyphCacheItem::Bitmap_top, PG_Font::BOLD, PG_FontFaceCacheItem::Bold_Offset, PG_FontFaceCacheItem::Descent, PG_FontFaceCacheItem::Face, PG_Font::GetFaceCache(), PG_Font::GetStyle(), PG_FontFaceCacheItem::Height, PG_FontFaceCacheItem::LineSkip, and PG_FontFaceCacheItem::Use_Kerning.

Referenced by PG_DropDown::AddItem(), PG_Widget::GetTextSize(), PG_Widget::RenderText(), PG_Widget::SetSizeByText(), PG_Label::SetSizeByText(), and PG_Button::SetSizeByText().

bool PG_FontEngine::RenderText SDL_Surface *  Surface,
const PG_Rect ClipRect,
int  BaseLineX,
int  BaseLineY,
const PG_String &  Text,
PG_Font ParamIn
[static]
 

Definition at line 510 of file pgfont.cpp.

References PG_GlyphCacheItem::Advance_x, PG_GlyphCacheItem::Bitmap, PG_GlyphCacheItem::Bitmap_left, PG_GlyphCacheItem::Bitmap_top, BlitFTBitmap(), PG_Font::BOLD, PG_FontFaceCacheItem::Bold_Offset, PG_FontFaceCacheItem::Face, PG_Font::GetColor(), PG_Font::GetFaceCache(), PG_Font::GetStyle(), PG_Char, RenderText(), PG_Font::UNDERLINE, PG_FontFaceCacheItem::Underline_Height, and PG_FontFaceCacheItem::Use_Kerning.

bool PG_FontEngine::RenderText SDL_Surface *  Surface,
const PG_Rect ClipRect,
int  BaseLineX,
int  BaseLineY,
const PG_String &  Text,
PG_Font ParamIn
[static]
 

render text onto a surface

Parameters:
Surface destination for rendered text
ClipRect clipping rectangle
BaseLineX x-startposition of the rendered text (inside the surface)
BaseLineY baseline of the rendered text (inside the surface)
Text text to render
ParamIn pointer to font
Returns:
true on success

Definition at line 506 of file pgfont.cpp.

Referenced by MapComponent::displayClip(), PG_Widget::DrawText(), PG_RichEdit::eventBlit(), VisibilityLayer::paintSingleField(), PG_Widget::RenderText(), and RenderText().


Friends And Related Function Documentation

friend class PG_Font [friend]
 

Definition at line 256 of file pgfont.h.

Referenced by PG_Application::LoadTheme().


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