this class wraps FreeType2
More...
#include <FntWrapFreeType.h>
|
static eC_Bool | CreateInstance (const eC_UInt &uiCacheSize, const eC_UInt &uiMaxNumFaces=10, const eC_UInt &uiMaxNumSizeObjects=10) |
|
static void | DeleteInstance () |
|
|
eC_Bool | m_bUseCache |
| if caching is used
|
|
FT_Library | m_pkFreeTypeLibrary |
| handle to freetype-library
|
|
eC_UInt | m_uiCacheSize |
| size of cache for font
|
|
eC_UInt | m_uiMaxNumFaces |
| maximum number of faces
|
|
eC_UInt | m_uiMaxNumSizeObjects |
| maximum size of one object
|
|
FontResource_t | m_eCurFont |
| Current font id.
|
|
CGUICommonEnums::Rotation_t | m_eRotation |
| Rotation.
|
|
eC_UInt | m_uiNOFFonts |
| Total number of fonts.
|
|
eC_Value | m_vSpacing |
| Font spacing, i.e the space between letters.
|
|
|
enum | GUIFont_t { FNT_NORMAL = 0
, FNT_ITALIC = 1
, FNT_UNDERLINED = 2
, FNT_BOLD = 4
} |
|
enum | TextOperation_t { RENDER_TEXT
, GET_REQUIRED_SPACE
} |
|
void | ChangeFont (const FontResource_t &eFontID, const eC_String &pcPath, const eC_UInt uiFontSize, const GUIFont_t &eFontStyle) |
|
virtual void | FittingNumChars (const eC_String *const pkText, eC_Value vWidthMax, eC_UInt &uiNumChars, const eC_Bool &bStartAtEnd=false) |
|
virtual eC_Int | GetAscender () const |
|
virtual eC_Int | GetDescender () const |
|
virtual void | GetGlyphMetrics (const eC_Char cChar, GlyphMetrics_t &kMetrics) |
|
virtual eC_Int | GetInternalLeading () const |
|
virtual eC_UInt | GetNOFFonts () |
|
CGUICommonEnums::Rotation_t | GetRotation () const |
|
virtual eC_Value | GetTextXPosAdjustment (const CGUIText::HorAligned_t eHorAlignment) |
|
virtual eC_Value | GetTextYPosAdjustment (const CGUIText::VerAligned_t eVerAlignment) |
|
virtual void | LoadFont (const FontResource_t &eFontID) |
|
virtual void | RequiredSpace (const eC_String *const pkText, eC_Value &vWidth, eC_Value &vHeight)=0 |
|
virtual void | SetFont (const FontResource_t &eID) |
|
virtual void | SetFontSpacing (const eC_Float &fSpacing) |
|
virtual eC_Bool | SetNOFFonts (const eC_UInt uiNOFFonts) |
|
void | SetRotation (const CGUICommonEnums::Rotation_t &eRotation) |
|
virtual void | Text (const eC_Value &vX1, const eC_Value &vY1, const eC_String *const lpString)=0 |
|
virtual void | UnloadFont (const FontResource_t &eFontID) |
|
this class wraps FreeType2
◆ CFntWrapFreeType()
CFntWrapFreeType::CFntWrapFreeType |
( |
const eC_UInt & |
uiCacheSize, |
|
|
const eC_UInt & |
uiMaxNumFaces, |
|
|
const eC_UInt & |
uiMaxNumSizeObjects |
|
) |
| |
|
protected |
Constructor.
- Parameters
-
uiCacheSize | The maximum size of the FreeType cache in byte. |
uiMaxNumFaces | Maximum number of opened font face objects managed by the FreeType cache. |
uiMaxNumSizeObjects | Maximum number of opened size objects managed by the FreeType cache. |
◆ CreateInstance()
static eC_Bool CFntWrapFreeType::CreateInstance |
( |
const eC_UInt & |
uiCacheSize, |
|
|
const eC_UInt & |
uiMaxNumFaces = 10 , |
|
|
const eC_UInt & |
uiMaxNumSizeObjects = 10 |
|
) |
| |
|
static |
Create a FntWrap-FreeType object. It should be created in implementation after creation of GfxWrap.
- Parameters
-
uiCacheSize | The max size of the freetype cache in bytes. |
uiMaxNumFaces | Maximum number of opened font face objects managed by the FreeType cache. |
uiMaxNumSizeObjects | Maximum number of opened size objects managed by the FreeType cache. |
- Returns
- True, if it is successfully created, False otherwise.
◆ GetAscender()
virtual eC_Int CFntWrapFreeType::GetAscender |
( |
| ) |
const |
|
inlineprotectedvirtual |
◆ GetDescender()
virtual eC_Int CFntWrapFreeType::GetDescender |
( |
| ) |
const |
|
inlineprotectedvirtual |
◆ GetGlyphMetrics()
virtual void CFntWrapFreeType::GetGlyphMetrics |
( |
const eC_Char |
cChar, |
|
|
GlyphMetrics_t & |
kMetrics |
|
) |
| |
|
protectedvirtual |
◆ GetInternalLeading()
virtual eC_Int CFntWrapFreeType::GetInternalLeading |
( |
| ) |
const |
|
inlineprotectedvirtual |
◆ LoadFont()
virtual void CFntWrapFreeType::LoadFont |
( |
const FontResource_t & |
eFontID | ) |
|
|
protectedvirtual |
Loads a font identified by eFontID into an array of fonts at position eFontID. If the font already exists, it's not loaded again. Should only be called by a FntWrapper.
- Parameters
-
eFontID | id (and hence index) of the font. False else. |
Reimplemented from CFntWrap.
Reimplemented in CFntWrapFreeTypeDAVE, and CFntWrapFreeTypeGL.
◆ RequiredSpace()
virtual void CFntWrapFreeType::RequiredSpace |
( |
const eC_String *const |
pkText, |
|
|
eC_Value & |
vWidth, |
|
|
eC_Value & |
vHeight |
|
) |
| |
|
protectedvirtual |
Calculates the required space in x- and y-direction of a given text with the currently active font.
- Parameters
-
pkText | The text. |
vWidth | Reference to width of the font in pixels. |
vHeight | Reference to height of the font in pixels. |
Implements CFntWrap.
◆ SetFont()
Sets a new font for the application.
- Parameters
-
eID | id (and hence index) of the font. |
Reimplemented from CFntWrap.
Reimplemented in CFntWrapFreeTypeDAVE.
◆ SetNOFFonts()
virtual eC_Bool CFntWrapFreeType::SetNOFFonts |
( |
const eC_UInt |
uiNOFFonts | ) |
|
|
protectedvirtual |
Sets the total number of fonts. This is called internally by the ResourceManager when dynamically allocated font resources require the total number of fonts to be raised. Derived classes will have to override this method and resize their internal font-storage structures according to the new number of fonts which will have to be stored.
- Parameters
-
uiNOFFonts | The number of fonts |
- Returns
- True if internal storage has been successfully adapted to support the requested number of fonts. False otherwise.
Reimplemented from CFntWrap.
Reimplemented in CFntWrapFreeTypeDAVE, and CFntWrapFreeTypeGL.
◆ Text()
virtual void CFntWrapFreeType::Text |
( |
const eC_Value & |
vX1, |
|
|
const eC_Value & |
vY1, |
|
|
const eC_String *const |
lpString |
|
) |
| |
|
protectedvirtual |
Print the text to screen.
- Parameters
-
vX1 | Absolute x position of the top-left corner of the bounding rectangle. |
vY1 | Absolute y position of the top-left corner of the bounding rectangle. |
lpString | The string to be printed. |
Implements CFntWrap.
◆ UnloadFont()
virtual void CFntWrapFreeType::UnloadFont |
( |
const FontResource_t & |
eFontID | ) |
|
|
protectedvirtual |
The documentation for this class was generated from the following file: