43 QFont
GetFont(
const QString &font_name,
int point_size = 10,
int weight = QFont::Normal);
60 explicit FontManager(QObject *parent =
nullptr): QObject(parent) {
91 bool LoadFont(
const QString &font_name,
const QString &font_path);
static FontManager * GetInstance()
Gets the singleton instance of the FontManager.
Definition font_manager.cpp:48
bool Initialize()
Initializes the FontManager by loading fonts from predefined paths.
Definition font_manager.cpp:7
QMap< QString, QString > font_families_
Map storing the mapping between logical font names and actual font family names.
Definition font_manager.h:80
FontManager(QObject *parent=nullptr)
Private constructor to enforce the singleton pattern.
Definition font_manager.h:60
QFont GetFont(const QString &font_name, int point_size=10, int weight=QFont::Normal)
Creates a QFont object with the specified logical name, size, and weight.
Definition font_manager.cpp:55
bool LoadFont(const QString &font_name, const QString &font_path)
Loads a single font file into the application using QFontDatabase.
Definition font_manager.cpp:74
QString GetFontFamily(const QString &font_name)
Retrieves the actual font family name associated with a logical font name.
Definition font_manager.cpp:62
~FontManager() override=default
Private default destructor.
static FontManager * instance_
Static pointer to the singleton instance.
Definition font_manager.h:71