GlyphLib (uGuiliani font) implementation of the Font Wrapper.
More...
#include <FntWrapGlyphLib.h>
|
void | LoadFont (const FontResource_t &eFontID) |
|
void | RequiredSpace (const eC_String *const pkText, eC_Value &vWidth, eC_Value &vHeight) |
|
void | SetFont (const FontResource_t &eID) |
|
void | UnloadFont (const FontResource_t &eFontID) |
|
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) |
|
|
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 void | RenderGlyphToScreen (const eC_Value &vX1, const eC_Value &vY1, CGUIImageData &kGlyphImage) |
|
virtual void | RenderTextInternal (const eC_String *lpString, const TextOperation_t &eOperation, const eC_Value &vX1, const eC_Value &vY1, eC_Value &vWidth, eC_Value &vHeight, eC_Value vWidthMax, eC_UInt &uiNumFittingChars) |
|
eC_Bool | SetNOFFonts (const eC_UInt uiNOFFonts) |
|
void | Text (const eC_Value &vX1, const eC_Value &vY1, const eC_String *const lpString) |
|
| CFntWrap () |
| Constructor.
|
|
virtual | ~CFntWrap () |
| Destructor.
|
|
void * | GetWorkingMemory (const eC_UInt &uiSize) |
|
void | ReleaseWorkingMemory () |
| release working memory
|
|
|
eC_TArray< FontEntry_s > | m_kFontsHandles |
| handles of all loaded fonts
|
|
eC_UInt | m_uiCurrentFontIndex |
| the currently used font-index
|
|
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.
|
|
GlyphLib (uGuiliani font) implementation of the Font Wrapper.
Platform Specific Limitations
As the CFntWrapGlyphLib uses a pre-compiled ROMFS to store the glyph bitmaps, it is not possible to change the number of used fonts via SetNOFFonts()
See CFntWrapGlyphLib Platform Specific Limitations This class is used to wrap the funtionality of the GlyphLib
◆ CreateInstance()
static eC_Bool CFntWrapGlyphLib::CreateInstance |
( |
| ) |
|
|
static |
Create the instance
- Returns
- true if successful
◆ GetAscender()
virtual eC_Int CFntWrapGlyphLib::GetAscender |
( |
| ) |
const |
|
protectedvirtual |
Returns the currently set font's ascender-metric. If the ascender is not supported by a given Font-Wrapper, this returns 0.
- Returns
- ascender in pixels
Reimplemented from CFntWrap.
Reimplemented in CFntWrapGlyphLibDAVE, and CFntWrapGlyphLibGL.
◆ GetDescender()
virtual eC_Int CFntWrapGlyphLib::GetDescender |
( |
| ) |
const |
|
protectedvirtual |
Returns the currently set font's descender-metric. If the descender is not supported by a given Font-Wrapper, this returns 0.
- Returns
- descender in pixels
Reimplemented from CFntWrap.
Reimplemented in CFntWrapGlyphLibDAVE, and CFntWrapGlyphLibGL.
◆ GetGlyphMetrics()
virtual void CFntWrapGlyphLib::GetGlyphMetrics |
( |
const eC_Char |
cChar, |
|
|
GlyphMetrics_t & |
kMetrics |
|
) |
| |
|
protectedvirtual |
◆ GetInternalLeading()
virtual eC_Int CFntWrapGlyphLib::GetInternalLeading |
( |
| ) |
const |
|
protectedvirtual |
Returns the currently set font's internal leading. If the internal leading is not supported by a given Font-Wrapper, this returns 0.
- Returns
- internal leading in pixels
Reimplemented from CFntWrap.
Reimplemented in CFntWrapGlyphLibDAVE, and CFntWrapGlyphLibGL.
◆ LoadFont()
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 CFntWrapGlyphLibGL.
◆ RenderGlyphToScreen()
virtual void CFntWrapGlyphLib::RenderGlyphToScreen |
( |
const eC_Value & |
vX1, |
|
|
const eC_Value & |
vY1, |
|
|
CGUIImageData & |
kGlyphImage |
|
) |
| |
|
protectedvirtual |
Renders a glyph to the screen. This function takes the 8 bit alpha image provided by freetype adds color and blits it to the screen.
- Parameters
-
vX1 | The x coordinate where the glyph image is rendered. |
vY1 | The y coordinate where the glyph image is rendered. |
kGlyphImage | The glyph image containing a 8 bit alpha image of the glyph. |
Reimplemented in CFntWrapGlyphLibDAVE.
◆ RenderTextInternal()
virtual void CFntWrapGlyphLib::RenderTextInternal |
( |
const eC_String * |
lpString, |
|
|
const TextOperation_t & |
eOperation, |
|
|
const eC_Value & |
vX1, |
|
|
const eC_Value & |
vY1, |
|
|
eC_Value & |
vWidth, |
|
|
eC_Value & |
vHeight, |
|
|
eC_Value |
vWidthMax, |
|
|
eC_UInt & |
uiNumFittingChars |
|
) |
| |
|
protectedvirtual |
Render a text
- Parameters
-
lpString | text |
eOperation | Use RENDER_TEXT to render the text or GET_REQUIRED_SPACE to calculate the required space. |
vX1 | x-position |
vY1 | y-position |
vWidth | the width needed for the text |
vHeight | the height needed for the text |
vWidthMax | the maximum width available |
uiNumFittingChars | maximum number of characters which will fit |
◆ RequiredSpace()
void CFntWrapGlyphLib::RequiredSpace |
( |
const eC_String *const |
pkText, |
|
|
eC_Value & |
vWidth, |
|
|
eC_Value & |
vHeight |
|
) |
| |
|
virtual |
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.
◆ SetNOFFonts()
eC_Bool CFntWrapGlyphLib::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 CFntWrapGlyphLibGL.
◆ Text()
void CFntWrapGlyphLib::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()
The documentation for this class was generated from the following file: