PixelLightAPI  .
Public Member Functions | Protected Attributes
PLGui::Font Class Reference

Font class. More...

#include <Font.h>

List of all members.

Public Member Functions

PLGUI_API Font (Gui &cGui)
 Constructor.
PLGUI_API Font (Gui &cGui, const PLCore::String &sFamily, PLCore::uint32 nHeight=0, EFontWeight nWeight=WeightNormal, EFontStyle nStyle=StyleNormal)
 Constructor.
PLGUI_API Font (Gui &cGui, const FontInfo &cFontInfo)
 Constructor.
PLGUI_API Font (const Font &cFont)
 Copy constructor.
PLGUI_API ~Font ()
 Destructor.
PLGUI_API Fontoperator= (const Font &cFont)
 Assignment operator.
PLGUI_API GuiGetGui () const
 Get owner GUI.
PLGUI_API FontImpl * GetImpl () const
 Get implementation.
PLGUI_API bool Load (const PLCore::String &sFamily, PLCore::uint32 nHeight=0, EFontWeight nWeight=WeightNormal, EFontStyle nStyle=StyleNormal)
 Load font.
PLGUI_API bool LoadFromFile (const PLCore::String &sFilename, PLCore::uint32 nHeight=0)
 Load font from file.
PLGUI_API FontInfo GetFontInfo () const
 Get font information.
PLGUI_API PLCore::String GetFilename () const
 Get font file name.
PLGUI_API PLCore::String GetFamily () const
 Get font family.
PLGUI_API void SetFamily (const PLCore::String &sFamily)
 Set font family.
PLGUI_API PLCore::uint32 GetHeight () const
 Get font height.
PLGUI_API void SetHeight (PLCore::uint32 nHeight)
 Set font height.
PLGUI_API EFontWeight GetWeight () const
 Get font weight.
PLGUI_API void SetWeight (EFontWeight nWeight)
 Set font weight.
PLGUI_API EFontStyle GetStyle () const
 Get font style.
PLGUI_API void SetStyle (EFontStyle nStyle)
 Set font style.

Protected Attributes

Guim_pGui
FontImpl * m_pFontImpl
PLCore::String m_sFamily
PLCore::uint32 m_nHeight
EFontWeight m_nWeight
EFontStyle m_nStyle
PLCore::String m_sFilename

Detailed Description

Font class.

Note:
  • Implementation of the bridge design pattern, this class is the abstraction

Constructor & Destructor Documentation

PLGUI_API PLGui::Font::Font ( Gui cGui)

Constructor.

Parameters:
[in]cGuiOwner GUI
PLGUI_API PLGui::Font::Font ( Gui cGui,
const PLCore::String sFamily,
PLCore::uint32  nHeight = 0,
EFontWeight  nWeight = WeightNormal,
EFontStyle  nStyle = StyleNormal 
)

Constructor.

Parameters:
[in]cGuiOwner GUI
[in]sFamilyFont family name
[in]nHeightFont height
[in]nWeightFont weight (
See also:
EFontWeight)
Parameters:
[in]nStyleFont style
PLGUI_API PLGui::Font::Font ( Gui cGui,
const FontInfo cFontInfo 
)

Constructor.

Parameters:
[in]cGuiOwner GUI
[in]cFontInfoFont information
PLGUI_API PLGui::Font::Font ( const Font cFont)

Copy constructor.

Parameters:
[in]cFontFont that is copied
PLGUI_API PLGui::Font::~Font ( )

Destructor.


Member Function Documentation

PLGUI_API Font& PLGui::Font::operator= ( const Font cFont)

Assignment operator.

Parameters:
[in]cFontFont that is copied
PLGUI_API Gui* PLGui::Font::GetGui ( ) const

Get owner GUI.

Returns:
Pointer to GUI object (never a null pointer)
PLGUI_API FontImpl* PLGui::Font::GetImpl ( ) const

Get implementation.

Returns:
Pointer to platform specific implementation
PLGUI_API bool PLGui::Font::Load ( const PLCore::String sFamily,
PLCore::uint32  nHeight = 0,
EFontWeight  nWeight = WeightNormal,
EFontStyle  nStyle = StyleNormal 
)

Load font.

Parameters:
[in]sFamilyFont family name
[in]nHeightFont height
[in]nWeightFont weight (
See also:
EFontWeight)
Parameters:
[in]nStyleFont style
Returns:
'true' if all went fine, else 'false'
PLGUI_API bool PLGui::Font::LoadFromFile ( const PLCore::String sFilename,
PLCore::uint32  nHeight = 0 
)

Load font from file.

Parameters:
[in]sFilenameFont filename
[in]nHeightFont height
Returns:
'true' if all went fine, else 'false'
PLGUI_API FontInfo PLGui::Font::GetFontInfo ( ) const

Get font information.

Returns:
Font info

Get font file name.

Returns:
File name
Remarks:
Will only return a file name if the font has been created using the according constructor

Get font family.

Returns:
Font family name
PLGUI_API void PLGui::Font::SetFamily ( const PLCore::String sFamily)

Set font family.

Parameters:
[in]sFamilyFont family name
PLGUI_API PLCore::uint32 PLGui::Font::GetHeight ( ) const

Get font height.

Returns:
Font height
PLGUI_API void PLGui::Font::SetHeight ( PLCore::uint32  nHeight)

Set font height.

Parameters:
[in]nHeightFont height
PLGUI_API EFontWeight PLGui::Font::GetWeight ( ) const

Get font weight.

Returns:
Font weight
PLGUI_API void PLGui::Font::SetWeight ( EFontWeight  nWeight)

Set font weight.

Parameters:
[in]nWeightFont weight (
See also:
EFontWeight)
PLGUI_API EFontStyle PLGui::Font::GetStyle ( ) const

Get font style.

Returns:
Font style
PLGUI_API void PLGui::Font::SetStyle ( EFontStyle  nStyle)

Set font style.

Parameters:
[in]nStyleFont style

Member Data Documentation

Gui* PLGui::Font::m_pGui [protected]

Pointer to GUI

FontImpl* PLGui::Font::m_pFontImpl [protected]

Font implementation

Font family

PLCore::uint32 PLGui::Font::m_nHeight [protected]

Font height

Font weight

Font style (normal, italics, ...)

Filename for directly loaded fonts


The documentation for this class was generated from the following file:


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:18
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported