Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
GUIFontManager Class Reference

#include <GUIFontManager.h>

Inheritance diagram for GUIFontManager:
IMsgTargetCallback

Public Member Functions

 GUIFontManager ()
 
 ~GUIFontManager () override
 
void Initialize ()
 Initialize the font manager. Checks that fonts cache are up to date, otherwise update it.
 
bool IsUpdating () const
 
bool OnMessage (CGUIMessage &message) override
 
void Unload (const std::string &strFontName)
 
void LoadFonts (const std::string &fontSet)
 
CGUIFontLoadTTF (const std::string &strFontName, const std::string &strFilename, KODI::UTILS::COLOR::Color textColor, KODI::UTILS::COLOR::Color shadowColor, const int iSize, const int iStyle, bool border=false, float lineSpacing=1.0f, float aspect=1.0f, const RESOLUTION_INFO *res=nullptr, bool preserveAspect=false)
 
CGUIFontGetFont (const std::string &strFontName, bool fallback=true)
 
CGUIFontGetDefaultFont (bool border=false)
 return a default font
 
void Clear ()
 
void FreeFontFile (CGUIFontTTF *pFont)
 
std::vector< std::string > GetUserFontsFamilyNames ()
 Get the list of user fonts as family names from cache.
 
- Public Member Functions inherited from IMsgTargetCallback
virtual ~IMsgTargetCallback ()=default
 

Static Public Member Functions

static void SettingOptionsFontsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string &current, void *data)
 

Protected Member Functions

void ReloadTTFFonts ()
 
void LoadFonts (const TiXmlNode *fontNode)
 
CGUIFontTTFGetFontFile (const std::string &fontIdent)
 

Static Protected Member Functions

static void RescaleFontSizeAndAspect (CGraphicContext &context, float *size, float *aspect, const RESOLUTION_INFO &sourceRes, bool preserveAspect)
 
static void GetStyle (const TiXmlNode *fontNode, int &iStyle)
 

Protected Attributes

std::vector< std::unique_ptr< CGUIFont > > m_vecFonts
 
std::vector< std::unique_ptr< CGUIFontTTF > > m_vecFontFiles
 
std::vector< OrigFontInfom_vecFontInfo
 
RESOLUTION_INFO m_skinResolution
 
bool m_canReload {true}
 

Constructor & Destructor Documentation

◆ GUIFontManager()

GUIFontManager::GUIFontManager ( )
default

◆ ~GUIFontManager()

GUIFontManager::~GUIFontManager ( )
override

Member Function Documentation

◆ Clear()

void GUIFontManager::Clear ( )

◆ FreeFontFile()

void GUIFontManager::FreeFontFile ( CGUIFontTTF * pFont)

◆ GetDefaultFont()

CGUIFont * GUIFontManager::GetDefaultFont ( bool border = false)

return a default font

Parameters
borderwhether the font should be a font with an outline
Returns
the font. nullptr if no default font can be found.

◆ GetFont()

CGUIFont * GUIFontManager::GetFont ( const std::string & strFontName,
bool fallback = true )

◆ GetFontFile()

CGUIFontTTF * GUIFontManager::GetFontFile ( const std::string & fontIdent)
protected

◆ GetStyle()

void GUIFontManager::GetStyle ( const TiXmlNode * fontNode,
int & iStyle )
staticprotected

◆ GetUserFontsFamilyNames()

std::vector< std::string > GUIFontManager::GetUserFontsFamilyNames ( )

Get the list of user fonts as family names from cache.

Returns
The list of available fonts family names

◆ Initialize()

void GUIFontManager::Initialize ( )

Initialize the font manager. Checks that fonts cache are up to date, otherwise update it.

◆ IsUpdating()

bool GUIFontManager::IsUpdating ( ) const
inline

◆ LoadFonts() [1/2]

void GUIFontManager::LoadFonts ( const std::string & fontSet)

◆ LoadFonts() [2/2]

void GUIFontManager::LoadFonts ( const TiXmlNode * fontNode)
protected

◆ LoadTTF()

CGUIFont * GUIFontManager::LoadTTF ( const std::string & strFontName,
const std::string & strFilename,
KODI::UTILS::COLOR::Color textColor,
KODI::UTILS::COLOR::Color shadowColor,
const int iSize,
const int iStyle,
bool border = false,
float lineSpacing = 1.0f,
float aspect = 1.0f,
const RESOLUTION_INFO * res = nullptr,
bool preserveAspect = false )

◆ OnMessage()

bool GUIFontManager::OnMessage ( CGUIMessage & message)
overridevirtual

Implements IMsgTargetCallback.

◆ ReloadTTFFonts()

void GUIFontManager::ReloadTTFFonts ( void )
protected

◆ RescaleFontSizeAndAspect()

void GUIFontManager::RescaleFontSizeAndAspect ( CGraphicContext & context,
float * size,
float * aspect,
const RESOLUTION_INFO & sourceRes,
bool preserveAspect )
staticprotected

◆ SettingOptionsFontsFiller()

void GUIFontManager::SettingOptionsFontsFiller ( const std::shared_ptr< const CSetting > & setting,
std::vector< StringSettingOption > & list,
std::string & current,
void * data )
static

◆ Unload()

void GUIFontManager::Unload ( const std::string & strFontName)

Member Data Documentation

◆ m_canReload

bool GUIFontManager::m_canReload {true}
protected

◆ m_skinResolution

RESOLUTION_INFO GUIFontManager::m_skinResolution
protected

◆ m_vecFontFiles

std::vector<std::unique_ptr<CGUIFontTTF> > GUIFontManager::m_vecFontFiles
protected

◆ m_vecFontInfo

std::vector<OrigFontInfo> GUIFontManager::m_vecFontInfo
protected

◆ m_vecFonts

std::vector<std::unique_ptr<CGUIFont> > GUIFontManager::m_vecFonts
protected

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