Fix unused warnings with DESKTOP_APP_USE_PACKAGED_FONTS

This commit is contained in:
Ilya Fedin 2023-09-22 04:48:27 +04:00 committed by John Preston
parent 68b43db05d
commit b361d6151c

View file

@ -71,6 +71,7 @@ bool ValidateFont(const QString &familyName, int flags = 0) {
return true; return true;
} }
#ifndef LIB_UI_USE_PACKAGED_FONTS
bool LoadCustomFont(const QString &filePath, const QString &familyName, int flags = 0) { bool LoadCustomFont(const QString &filePath, const QString &familyName, int flags = 0) {
auto regularId = QFontDatabase::addApplicationFont(filePath); auto regularId = QFontDatabase::addApplicationFont(filePath);
if (regularId < 0) { if (regularId < 0) {
@ -94,6 +95,7 @@ bool LoadCustomFont(const QString &filePath, const QString &familyName, int flag
return ValidateFont(familyName, flags); return ValidateFont(familyName, flags);
} }
#endif // !LIB_UI_USE_PACKAGED_FONTS
[[nodiscard]] QString SystemMonospaceFont() { [[nodiscard]] QString SystemMonospaceFont() {
const auto type = QFontDatabase::FixedFont; const auto type = QFontDatabase::FixedFont;
@ -160,7 +162,6 @@ QString FontTypePersianFallback[FontTypesCount] = {
"DAVazirMedium", "DAVazirMedium",
"DAVazirMedium", "DAVazirMedium",
}; };
#endif // !LIB_UI_USE_PACKAGED_FONTS
int32 FontTypeFlags[FontTypesCount] = { int32 FontTypeFlags[FontTypesCount] = {
0, 0,
FontItalic, FontItalic,
@ -169,6 +170,7 @@ int32 FontTypeFlags[FontTypesCount] = {
FontSemibold, FontSemibold,
FontSemibold | FontItalic, FontSemibold | FontItalic,
}; };
#endif // !LIB_UI_USE_PACKAGED_FONTS
bool Started = false; bool Started = false;
QString Overrides[FontTypesCount]; QString Overrides[FontTypesCount];