diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-12-08 19:14:54 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-12-08 19:14:54 +0200 |
commit | eae5e61bba99c97af3d8b27dab39d50aedeb3b04 (patch) | |
tree | b8c932a745f77845f79aea464d5195ce36109ee9 /src/ui/text.h | |
parent | 6efe7e2916c2391538aa41d6c2226f8c1a9cafc3 (diff) |
Text: Ignore Unicode joiners and modifiers
The fonts bundled with Lagrange currently do not have all the latest Unicode symbols, so we'll ignore the joiners and modifiers for gender and skin color.
A better option would be to fall back to system-provided text rendering, if that is available.
IssueID #81
Diffstat (limited to 'src/ui/text.h')
-rw-r--r-- | src/ui/text.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/ui/text.h b/src/ui/text.h index 5bae8e2a..a0b2dc1a 100644 --- a/src/ui/text.h +++ b/src/ui/text.h | |||
@@ -114,11 +114,21 @@ enum iFontId { | |||
114 | iLocalDef iBool isJapanese_FontId(enum iFontId id) { | 114 | iLocalDef iBool isJapanese_FontId(enum iFontId id) { |
115 | return id >= defaultJapanese_FontId && id <= hugeJapanese_FontId; | 115 | return id >= defaultJapanese_FontId && id <= hugeJapanese_FontId; |
116 | } | 116 | } |
117 | iLocalDef iBool isVariationSelector_Char(iChar ch) { | 117 | iLocalDef iBool isVariationSelector_Char(iChar c) { |
118 | return ch >= 0xfe00 && ch <= 0xfe0f; | 118 | return (c >= 0xfe00 && c <= 0xfe0f) || (c >= 0xe0100 && c <= 0xe0121); |
119 | } | ||
120 | iLocalDef iBool isFitzpatrickType_Char(iChar c) { | ||
121 | return c >= 0x1f3fb && c <= 0x1f3ff; | ||
122 | } | ||
123 | iLocalDef iBool isDefaultIgnorable_Char(iChar c) { | ||
124 | return c == 0x115f || (c >= 0x200b && c <= 0x200e) || c == 0x2060 || c == 0x2061 || | ||
125 | c == 0xfeff; | ||
126 | } | ||
127 | iLocalDef iBool isEmoji_Char(iChar c) { | ||
128 | return (c >= 0x1f300 && c < 0x1f700) || (c >= 0x1f900 && c <= 0x1f9ff); | ||
119 | } | 129 | } |
120 | 130 | ||
121 | #define variationSelectorEmoji_Char ((iChar) 0xfe0f) | 131 | #define emojiVariationSelector_Char ((iChar) 0xfe0f) |
122 | 132 | ||
123 | enum iTextFont { | 133 | enum iTextFont { |
124 | nunito_TextFont, | 134 | nunito_TextFont, |