MythTV
master
|
#include <mythfontmanager.h>
Public Member Functions | |
MythFontManager ()=default | |
void | LoadFonts (const QString &directory, const QString ®isteredFor) |
Loads the fonts in font files within the given directory structure. More... | |
void | ReleaseFonts (const QString ®isteredFor) |
Removes the font references for registeredFor, and unloads the application font if it's no longer in use. More... | |
Static Public Member Functions | |
static MythFontManager * | GetGlobalFontManager (void) |
Private Member Functions | |
void | LoadFonts (const QString &directory, const QString ®isteredFor, int *maxDirs) |
Loads the fonts in font files within the given directory structure. More... | |
void | LoadFontsFromDirectory (const QString &directory, const QString ®isteredFor) |
Loads fonts from font files in the specified directory. More... | |
void | LoadFontFile (const QString &fontPath, const QString ®isteredFor) |
Loads fonts from the file specified in fontPath. More... | |
bool | RegisterFont (const QString &fontPath, const QString ®isteredFor, int fontID=-1) |
Registers the font as being used by registeredFor. More... | |
bool | IsFontFileLoaded (const QString &fontPath) |
Checks whether the specified font file has already been loaded. More... | |
Private Attributes | |
QMutex | m_lock |
FontPathToReference | m_fontPathToReference |
Definition at line 17 of file mythfontmanager.h.
|
default |
Referenced by GetGlobalFontManager().
void MythFontManager::LoadFonts | ( | const QString & | directory, |
const QString & | registeredFor | ||
) |
Loads the fonts in font files within the given directory structure.
Scans directory and its subdirectories, up to MAX_DIRS total, looking for TrueType (.ttf) and OpenType (.otf) font files or TrueType font collections (.ttc) and loads the fonts to make them available to the application.
directory | The directory to scan |
registeredFor | The user of the font. Used with releaseFonts() to unload the font if no longer in use (by any users) |
Definition at line 29 of file mythfontmanager.cpp.
Referenced by LoadFonts(), MythThemeBase::MythThemeBase(), and MythThemeBase::Reload().
void MythFontManager::ReleaseFonts | ( | const QString & | registeredFor | ) |
Removes the font references for registeredFor, and unloads the application font if it's no longer in use.
registeredFor | The user of the font, as specified to LoadFonts() |
Definition at line 117 of file mythfontmanager.cpp.
Referenced by MythThemeBase::Reload(), and MythThemeBase::~MythThemeBase().
|
static |
Definition at line 279 of file mythfontmanager.cpp.
Referenced by GetGlobalFontManager().
|
private |
Loads the fonts in font files within the given directory structure.
Recursively scans all directories under directory looking for TrueType (.ttf) and OpenType (.otf) font files or TrueType font collections (.ttc) and loads the fonts to make them available to the application.
directory | The directory to scan |
registeredFor | The user of the font. Used with releaseFonts() to unload the font if no longer in use (by any users) |
maxDirs | The maximum number of subdirectories to scan |
Definition at line 81 of file mythfontmanager.cpp.
|
private |
Loads fonts from font files in the specified directory.
Non-recursive function called by the recursive MythFontManager::LoadFonts() function.
directory | The directory to scan |
registeredFor | The user of the font. |
Definition at line 167 of file mythfontmanager.cpp.
Referenced by LoadFonts().
|
private |
Loads fonts from the file specified in fontPath.
fontPath | The absolute path to the font file |
registeredFor | The user of the font. |
Definition at line 189 of file mythfontmanager.cpp.
Referenced by LoadFontsFromDirectory().
|
private |
Registers the font as being used by registeredFor.
fontPath | The absolute path to the font file |
registeredFor | The user of the font. |
fontID | The number provided by Qt when the font was registered. |
Definition at line 247 of file mythfontmanager.cpp.
Referenced by LoadFontFile().
|
private |
Checks whether the specified font file has already been loaded.
fontPath | The absolute path to the font file |
Definition at line 273 of file mythfontmanager.cpp.
Referenced by LoadFontFile(), and ReleaseFonts().
|
private |
Definition at line 37 of file mythfontmanager.h.
Referenced by LoadFontFile(), and ReleaseFonts().
|
private |
Definition at line 38 of file mythfontmanager.h.
Referenced by IsFontFileLoaded(), RegisterFont(), and ReleaseFonts().