#include <mythfontmanager.h>
Public Member Functions | |
| MythFontManager () | |
| void | LoadFonts (const QString &directory, const QString ®isteredFor) |
| Loads the fonts in font files within the given directory structure. | |
| void | ReleaseFonts (const QString ®isteredFor) |
| Removes the font references for registeredFor, and unloads the application font if it's no longer in use. | |
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. | |
| void | LoadFontsFromDirectory (const QString &directory, const QString ®isteredFor) |
| Loads fonts from font files in the specified directory. | |
| void | LoadFontFile (const QString &fontPath, const QString ®isteredFor) |
| Loads fonts from the file specified in fontPath. | |
| bool | RegisterFont (const QString &fontPath, const QString ®isteredFor, const int fontID=-1) |
| Registers the font as being used by registeredFor. | |
| bool | IsFontFileLoaded (const QString &fontPath) |
| Checks whether the specified font file has already been loaded. | |
Private Attributes | |
| QMutex | m_lock |
| FontPathToReference | m_fontPathToReference |
Definition at line 13 of file mythfontmanager.h.
| MythFontManager::MythFontManager | ( | ) | [inline] |
Definition at line 16 of file mythfontmanager.h.
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 28 of file mythfontmanager.cpp.
Referenced by MythThemeBase::Init(), LoadFonts(), 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 84 of file mythfontmanager.cpp.
Referenced by MythThemeBase::Reload(), and MythThemeBase::~MythThemeBase().
| MythFontManager * MythFontManager::GetGlobalFontManager | ( | void | ) | [static] |
Definition at line 249 of file mythfontmanager.cpp.
Referenced by GetGlobalFontManager().
| void MythFontManager::LoadFonts | ( | const QString & | directory, | |
| const QString & | registeredFor, | |||
| int * | maxDirs | |||
| ) | [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 47 of file mythfontmanager.cpp.
| void MythFontManager::LoadFontsFromDirectory | ( | const QString & | directory, | |
| const QString & | registeredFor | |||
| ) | [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 134 of file mythfontmanager.cpp.
Referenced by LoadFonts().
| void MythFontManager::LoadFontFile | ( | const QString & | fontPath, | |
| const QString & | registeredFor | |||
| ) | [private] |
Loads fonts from the file specified in fontPath.
| directory | The directory to scan | |
| registeredFor | The user of the font. |
Definition at line 159 of file mythfontmanager.cpp.
Referenced by LoadFontsFromDirectory().
| bool MythFontManager::RegisterFont | ( | const QString & | fontPath, | |
| const QString & | registeredFor, | |||
| const int | fontID = -1 | |||
| ) | [private] |
Registers the font as being used by registeredFor.
| directory | The directory to scan | |
| registeredFor | The user of the font. |
Definition at line 215 of file mythfontmanager.cpp.
Referenced by LoadFontFile().
| bool MythFontManager::IsFontFileLoaded | ( | const QString & | fontPath | ) | [private] |
Checks whether the specified font file has already been loaded.
| fontPath | The absolute path to the font file |
Definition at line 243 of file mythfontmanager.cpp.
Referenced by LoadFontFile(), and ReleaseFonts().
QMutex MythFontManager::m_lock [private] |
Definition at line 33 of file mythfontmanager.h.
Referenced by LoadFontFile(), and ReleaseFonts().
Definition at line 34 of file mythfontmanager.h.
Referenced by IsFontFileLoaded(), RegisterFont(), and ReleaseFonts().
1.6.3