Kodi Documentation  18.0
Kodi is an open source media player and entertainment hub.
CGUIFontTTFBase Class Referenceabstract

#include <GUIFontTTF.h>

Inheritance diagram for CGUIFontTTFBase:
CGUIFontTTFDX CGUIFontTTFGL

Classes

struct  Character
 
struct  CTranslatedVertices
 

Public Member Functions

 CGUIFontTTFBase (const std::string &strFileName)
 
virtual ~CGUIFontTTFBase (void)
 
void Clear ()
 
bool Load (const std::string &strFilename, float height=20.0f, float aspect=1.0f, float lineSpacing=1.0f, bool border=false)
 
void Begin ()
 
void End ()
 
virtual CVertexBuffer CreateVertexBuffer (const std::vector< SVertex > &vertices) const
 
virtual void DestroyVertexBuffer (CVertexBuffer &bufferHandle) const
 
const std::string & GetFileName () const
 

Protected Member Functions

void AddReference ()
 
void RemoveReference ()
 
float GetTextWidthInternal (vecText::const_iterator start, vecText::const_iterator end)
 
float GetCharWidthInternal (character_t ch)
 
float GetTextHeight (float lineSpacing, int numLines) const
 
float GetTextBaseLine () const
 
float GetLineHeight (float lineSpacing) const
 
float GetFontHeight () const
 
void DrawTextInternal (float x, float y, const std::vector< UTILS::Color > &colors, const vecText &text, uint32_t alignment, float maxPixelWidth, bool scrolling)
 
CharacterGetCharacter (character_t letter)
 
bool CacheCharacter (wchar_t letter, uint32_t style, Character *ch)
 
void RenderCharacter (float posX, float posY, const Character *ch, UTILS::Color color, bool roundX, std::vector< SVertex > &vertices)
 
void ClearCharacterCache ()
 
virtual CBaseTextureReallocTexture (unsigned int &newHeight)=0
 
virtual bool CopyCharToTexture (FT_BitmapGlyph bitGlyph, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2)=0
 
virtual void DeleteHardwareTexture ()=0
 
void SetGlyphStrength (FT_GlyphSlot slot, int glyphStrength)
 
unsigned int GetTextureLineHeight () const
 the height of each line in the texture. Accounts for spacing between lines to avoid characters overlapping. More...
 

Static Protected Member Functions

static void ObliqueGlyph (FT_GlyphSlot slot)
 

Protected Attributes

float m_height
 
std::string m_strFilename
 
CBaseTexturem_texture
 
unsigned int m_textureWidth
 
unsigned int m_textureHeight
 
int m_posX
 
int m_posY
 
UTILS::Color m_color
 
Characterm_char
 
Characterm_charquick [LOOKUPTABLE_SIZE]
 
int m_maxChars
 
int m_numChars
 
float m_ellipsesWidth
 
unsigned int m_cellBaseLine
 
unsigned int m_cellHeight
 
unsigned int m_nestedBeginCount
 
FT_Face m_face
 
FT_Stroker m_stroker
 
float m_originX
 
float m_originY
 
unsigned int m_nTexture
 
std::vector< CTranslatedVerticesm_vertexTrans
 
std::vector< SVertexm_vertex
 
float m_textureScaleX
 
float m_textureScaleY
 
std::string m_strFileName
 
XUTILS::auto_buffer m_fontFileInMemory
 
CGUIFontCache< CGUIFontCacheStaticPosition, CGUIFontCacheStaticValuem_staticCache
 
CGUIFontCache< CGUIFontCacheDynamicPosition, CGUIFontCacheDynamicValuem_dynamicCache
 
CRenderSystemBasem_renderSystem = nullptr
 

Static Protected Attributes

static const unsigned int spacing_between_characters_in_texture = 1
 

Friends

class CGUIFont
 

Constructor & Destructor Documentation

§ CGUIFontTTFBase()

CGUIFontTTFBase::CGUIFontTTFBase ( const std::string &  strFileName)
explicit

§ ~CGUIFontTTFBase()

CGUIFontTTFBase::~CGUIFontTTFBase ( void  )
virtual

Member Function Documentation

§ AddReference()

void CGUIFontTTFBase::AddReference ( )
protected

§ Begin()

void CGUIFontTTFBase::Begin ( )

§ CacheCharacter()

bool CGUIFontTTFBase::CacheCharacter ( wchar_t  letter,
uint32_t  style,
Character ch 
)
protected

§ Clear()

void CGUIFontTTFBase::Clear ( )

§ ClearCharacterCache()

void CGUIFontTTFBase::ClearCharacterCache ( )
protected

§ CopyCharToTexture()

virtual bool CGUIFontTTFBase::CopyCharToTexture ( FT_BitmapGlyph  bitGlyph,
unsigned int  x1,
unsigned int  y1,
unsigned int  x2,
unsigned int  y2 
)
protectedpure virtual

Implemented in CGUIFontTTFDX, and CGUIFontTTFGL.

§ CreateVertexBuffer()

virtual CVertexBuffer CGUIFontTTFBase::CreateVertexBuffer ( const std::vector< SVertex > &  vertices) const
inlinevirtual

Reimplemented in CGUIFontTTFDX, and CGUIFontTTFGL.

§ DeleteHardwareTexture()

virtual void CGUIFontTTFBase::DeleteHardwareTexture ( )
protectedpure virtual

Implemented in CGUIFontTTFDX, and CGUIFontTTFGL.

§ DestroyVertexBuffer()

virtual void CGUIFontTTFBase::DestroyVertexBuffer ( CVertexBuffer bufferHandle) const
inlinevirtual

Reimplemented in CGUIFontTTFDX, and CGUIFontTTFGL.

§ DrawTextInternal()

void CGUIFontTTFBase::DrawTextInternal ( float  x,
float  y,
const std::vector< UTILS::Color > &  colors,
const vecText text,
uint32_t  alignment,
float  maxPixelWidth,
bool  scrolling 
)
protected

§ End()

void CGUIFontTTFBase::End ( )

§ GetCharacter()

CGUIFontTTFBase::Character * CGUIFontTTFBase::GetCharacter ( character_t  letter)
inlineprotected

§ GetCharWidthInternal()

float CGUIFontTTFBase::GetCharWidthInternal ( character_t  ch)
protected

§ GetFileName()

const std::string& CGUIFontTTFBase::GetFileName ( ) const
inline

§ GetFontHeight()

float CGUIFontTTFBase::GetFontHeight ( ) const
inlineprotected

§ GetLineHeight()

float CGUIFontTTFBase::GetLineHeight ( float  lineSpacing) const
protected

§ GetTextBaseLine()

float CGUIFontTTFBase::GetTextBaseLine ( ) const
inlineprotected

§ GetTextHeight()

float CGUIFontTTFBase::GetTextHeight ( float  lineSpacing,
int  numLines 
) const
protected

§ GetTextureLineHeight()

unsigned int CGUIFontTTFBase::GetTextureLineHeight ( ) const
protected

the height of each line in the texture. Accounts for spacing between lines to avoid characters overlapping.

§ GetTextWidthInternal()

float CGUIFontTTFBase::GetTextWidthInternal ( vecText::const_iterator  start,
vecText::const_iterator  end 
)
protected

§ Load()

bool CGUIFontTTFBase::Load ( const std::string &  strFilename,
float  height = 20.0f,
float  aspect = 1.0f,
float  lineSpacing = 1.0f,
bool  border = false 
)

§ ObliqueGlyph()

void CGUIFontTTFBase::ObliqueGlyph ( FT_GlyphSlot  slot)
staticprotected

§ ReallocTexture()

virtual CBaseTexture* CGUIFontTTFBase::ReallocTexture ( unsigned int &  newHeight)
protectedpure virtual

Implemented in CGUIFontTTFDX, and CGUIFontTTFGL.

§ RemoveReference()

void CGUIFontTTFBase::RemoveReference ( )
protected

§ RenderCharacter()

void CGUIFontTTFBase::RenderCharacter ( float  posX,
float  posY,
const Character ch,
UTILS::Color  color,
bool  roundX,
std::vector< SVertex > &  vertices 
)
protected

§ SetGlyphStrength()

void CGUIFontTTFBase::SetGlyphStrength ( FT_GlyphSlot  slot,
int  glyphStrength 
)
protected

Friends And Related Function Documentation

§ CGUIFont

friend class CGUIFont
friend

Member Data Documentation

§ m_cellBaseLine

unsigned int CGUIFontTTFBase::m_cellBaseLine
protected

§ m_cellHeight

unsigned int CGUIFontTTFBase::m_cellHeight
protected

§ m_char

Character* CGUIFontTTFBase::m_char
protected

§ m_charquick

Character* CGUIFontTTFBase::m_charquick[LOOKUPTABLE_SIZE]
protected

§ m_color

UTILS::Color CGUIFontTTFBase::m_color
protected

§ m_dynamicCache

CGUIFontCache<CGUIFontCacheDynamicPosition, CGUIFontCacheDynamicValue> CGUIFontTTFBase::m_dynamicCache
protected

§ m_ellipsesWidth

float CGUIFontTTFBase::m_ellipsesWidth
protected

§ m_face

FT_Face CGUIFontTTFBase::m_face
protected

§ m_fontFileInMemory

XUTILS::auto_buffer CGUIFontTTFBase::m_fontFileInMemory
protected

§ m_height

float CGUIFontTTFBase::m_height
protected

§ m_maxChars

int CGUIFontTTFBase::m_maxChars
protected

§ m_nestedBeginCount

unsigned int CGUIFontTTFBase::m_nestedBeginCount
protected

§ m_nTexture

unsigned int CGUIFontTTFBase::m_nTexture
protected

§ m_numChars

int CGUIFontTTFBase::m_numChars
protected

§ m_originX

float CGUIFontTTFBase::m_originX
protected

§ m_originY

float CGUIFontTTFBase::m_originY
protected

§ m_posX

int CGUIFontTTFBase::m_posX
protected

§ m_posY

int CGUIFontTTFBase::m_posY
protected

§ m_renderSystem

CRenderSystemBase* CGUIFontTTFBase::m_renderSystem = nullptr
protected

§ m_staticCache

CGUIFontCache<CGUIFontCacheStaticPosition, CGUIFontCacheStaticValue> CGUIFontTTFBase::m_staticCache
protected

§ m_strFilename

std::string CGUIFontTTFBase::m_strFilename
protected

§ m_strFileName

std::string CGUIFontTTFBase::m_strFileName
protected

§ m_stroker

FT_Stroker CGUIFontTTFBase::m_stroker
protected

§ m_texture

CBaseTexture* CGUIFontTTFBase::m_texture
protected

§ m_textureHeight

unsigned int CGUIFontTTFBase::m_textureHeight
protected

§ m_textureScaleX

float CGUIFontTTFBase::m_textureScaleX
protected

§ m_textureScaleY

float CGUIFontTTFBase::m_textureScaleY
protected

§ m_textureWidth

unsigned int CGUIFontTTFBase::m_textureWidth
protected

§ m_vertex

std::vector<SVertex> CGUIFontTTFBase::m_vertex
protected

§ m_vertexTrans

std::vector<CTranslatedVertices> CGUIFontTTFBase::m_vertexTrans
protected

§ spacing_between_characters_in_texture

const unsigned int CGUIFontTTFBase::spacing_between_characters_in_texture = 1
staticprotected

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