Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
UTILS::FONT Namespace Reference

Namespaces

namespace  FONTPATH
 

Functions

bool GetFontFamilyNames (const std::vector< uint8_t > &buffer, std::set< std::string > &familyNames)
 Get the font family name from a font file, in case of font collection (.ttc) will take the family name of all fonts.
 
bool GetFontFamilyNames (const std::string &filepath, std::set< std::string > &familyNames)
 Get the font family name from a font file, in case of font collection (.ttc) will take the family name of all fonts.
 
std::string GetFontFamily (std::vector< uint8_t > &buffer)
 Get the font family name from a font file, in case of font collection (.ttc) will take the first available.
 
std::string GetFontFamily (const std::string &filepath)
 Get the font family name from a font file, in case of font collection (.ttc) will take the first available.
 
bool IsSupportedFontExtension (const std::string &filepath)
 Check if a filename have a supported font extension.
 
void ClearTemporaryFonts ()
 Removes all temporary fonts, e.g.those extract from MKV containers that are only available during playback.
 

Variables

constexpr const char * SUPPORTED_EXTENSIONS_MASK = ".ttf|.ttc|.otf"
 
constexpr const char * FONT_DEFAULT_FILENAME = "arial.ttf"
 

Function Documentation

◆ ClearTemporaryFonts()

void UTILS::FONT::ClearTemporaryFonts ( )

Removes all temporary fonts, e.g.those extract from MKV containers that are only available during playback.

◆ GetFontFamily() [1/2]

std::string UTILS::FONT::GetFontFamily ( const std::string & filepath)

Get the font family name from a font file, in case of font collection (.ttc) will take the first available.

Parameters
filepathThe path where read the font data
Returns
The font family name, otherwise empty if fails

◆ GetFontFamily() [2/2]

std::string UTILS::FONT::GetFontFamily ( std::vector< uint8_t > & buffer)

Get the font family name from a font file, in case of font collection (.ttc) will take the first available.

Parameters
bufferThe font data
Returns
The font family name, otherwise empty if fails

◆ GetFontFamilyNames() [1/2]

bool UTILS::FONT::GetFontFamilyNames ( const std::string & filepath,
std::set< std::string > & familyNames )

Get the font family name from a font file, in case of font collection (.ttc) will take the family name of all fonts.

Parameters
filepathThe path where read the font data
familyNamesThe font family names
Returns
True if success, otherwise false when an error occurs

◆ GetFontFamilyNames() [2/2]

bool UTILS::FONT::GetFontFamilyNames ( const std::vector< uint8_t > & buffer,
std::set< std::string > & familyNames )

Get the font family name from a font file, in case of font collection (.ttc) will take the family name of all fonts.

Parameters
bufferThe font data
familyNamesThe font family names
Returns
True if success, otherwise false when an error occurs

◆ IsSupportedFontExtension()

bool UTILS::FONT::IsSupportedFontExtension ( const std::string & filepath)

Check if a filename have a supported font extension.

Parameters
filepathThe font file path
Returns
True if it has a supported extension, otherwise false

Variable Documentation

◆ FONT_DEFAULT_FILENAME

const char* UTILS::FONT::FONT_DEFAULT_FILENAME = "arial.ttf"
constexpr

◆ SUPPORTED_EXTENSIONS_MASK

const char* UTILS::FONT::SUPPORTED_EXTENSIONS_MASK = ".ttf|.ttc|.otf"
constexpr