1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
Submodule Telegram/lib_ui contains modified content
diff --git a/Telegram/lib_ui/ui/style/style_core.cpp b/Telegram/lib_ui/ui/style/style_core.cpp
index 3f9b003..e63410b 100644
--- a/Telegram/lib_ui/ui/style/style_core.cpp
+++ b/Telegram/lib_ui/ui/style/style_core.cpp
@@ -55,10 +55,6 @@ void ResolveMonospaceFont() {
if (!CustomMonospaceFont.isEmpty()) {
tryFont(CustomMonospaceFont);
}
- tryFont("Consolas");
- tryFont("Liberation Mono");
- tryFont("Menlo");
- tryFont("Courier");
if (family.isEmpty()) {
const auto type = QFontDatabase::FixedFont;
family = QFontDatabase::systemFont(type).family();
diff --git a/Telegram/lib_ui/ui/style/style_core_font.cpp b/Telegram/lib_ui/ui/style/style_core_font.cpp
index ad3a9e3..db09e46 100644
--- a/Telegram/lib_ui/ui/style/style_core_font.cpp
+++ b/Telegram/lib_ui/ui/style/style_core_font.cpp
@@ -216,7 +216,12 @@ QString GetPossibleEmptyOverride(const QString &familyName, int32 flags) {
}
QString GetFontOverride(const QString &familyName, int32 flags) {
- const auto result = GetPossibleEmptyOverride(familyName, flags);
+ auto result = GetPossibleEmptyOverride(familyName, flags);
+
+ if (result.isEmpty() && (familyName == "Open Sans" || familyName == "Open Sans Semibold")) {
+ result = QFontDatabase::systemFont(QFontDatabase::GeneralFont).family();
+ }
+
return result.isEmpty() ? familyName : result;
}
@@ -253,7 +258,7 @@ FontData::FontData(int size, uint32 flags, int family, Font *other)
f.setPixelSize(size);
if (_flags & FontBold) {
f.setBold(true);
- } else if (fontFamilies[family] == "Open Sans Semibold" && CustomSemiboldIsBold) {
+ } else if (fontFamilies[family] == "Open Sans Semibold" && (CustomSemiboldIsBold || GetPossibleEmptyOverride(fontFamilies[family], flags).isEmpty())) {
f.setBold(true);
}
f.setItalic(_flags & FontItalic);
|