summaryrefslogtreecommitdiff
path: root/src/ui/text.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-09-21 07:00:19 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-09-21 07:00:19 +0300
commit7741365e5455c328a0d6525131827f47de36fc4b (patch)
tree5dd51cd95e446fb1ceef75a6ca8013d5904ee3ac /src/ui/text.h
parent7eae4386c6e82ff7f7aed322bd5e3b0ebf382813 (diff)
Text: Using Unicode symbols in monospace
If the regular monospace font is missing a Unicode character, one is used from Symbola. However, these replacements were taken from the wrong sized font. Also, since the replacements are not monospace (Symbola isn't) they are now centered in their location for a better alignment.
Diffstat (limited to 'src/ui/text.h')
-rw-r--r--src/ui/text.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ui/text.h b/src/ui/text.h
index dfdd6b7e..7dc4aa38 100644
--- a/src/ui/text.h
+++ b/src/ui/text.h
@@ -53,7 +53,8 @@ enum iFontId {
53 bigSymbols_FontId, 53 bigSymbols_FontId,
54 largeSymbols_FontId, 54 largeSymbols_FontId,
55 hugeSymbols_FontId, 55 hugeSymbols_FontId,
56 smallSymbols_FontId, 56 monospaceSymbols_FontId,
57 monospaceSmallSymbols_FontId,
57 /* emoji fonts */ 58 /* emoji fonts */
58 defaultEmoji_FontId, 59 defaultEmoji_FontId,
59 defaultMediumEmoji_FontId, 60 defaultMediumEmoji_FontId,
@@ -62,10 +63,12 @@ enum iFontId {
62 bigEmoji_FontId, 63 bigEmoji_FontId,
63 largeEmoji_FontId, 64 largeEmoji_FontId,
64 hugeEmoji_FontId, 65 hugeEmoji_FontId,
65 smallEmoji_FontId, 66 monospaceEmoji_FontId,
67 monospaceSmallEmoji_FontId,
66 /* japanese script */ 68 /* japanese script */
67 defaultJapanese_FontId, 69 defaultJapanese_FontId,
68 smallJapanese_FontId, 70 monospaceSmallJapanese_FontId,
71 monospaceJapanese_FontId,
69 regularJapanese_FontId, 72 regularJapanese_FontId,
70 mediumJapanese_FontId, 73 mediumJapanese_FontId,
71 bigJapanese_FontId, 74 bigJapanese_FontId,
@@ -74,7 +77,7 @@ enum iFontId {
74 max_FontId, 77 max_FontId,
75 78
76 /* Meta: */ 79 /* Meta: */
77 fromSymbolsToEmojiOffset_FontId = 8, 80 fromSymbolsToEmojiOffset_FontId = 9,
78 81
79 /* UI fonts: */ 82 /* UI fonts: */
80 uiLabel_FontId = default_FontId, 83 uiLabel_FontId = default_FontId,
@@ -94,7 +97,10 @@ enum iFontId {
94}; 97};
95 98
96iLocalDef iBool isJapanese_FontId(enum iFontId id) { 99iLocalDef iBool isJapanese_FontId(enum iFontId id) {
97 return id >= smallJapanese_FontId && id <= hugeJapanese_FontId; 100 return id >= defaultJapanese_FontId && id <= hugeJapanese_FontId;
101}
102iLocalDef iBool isVariationSelector_Char(iChar ch) {
103 return ch >= 0xfe00 && ch <= 0xfe0f;
98} 104}
99 105
100#define variationSelectorEmoji_Char ((iChar) 0xfe0f) 106#define variationSelectorEmoji_Char ((iChar) 0xfe0f)