summaryrefslogtreecommitdiff
path: root/src/ui/text.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-12-08 19:14:54 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-12-08 19:14:54 +0200
commiteae5e61bba99c97af3d8b27dab39d50aedeb3b04 (patch)
treeb8c932a745f77845f79aea464d5195ce36109ee9 /src/ui/text.h
parent6efe7e2916c2391538aa41d6c2226f8c1a9cafc3 (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.h16
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 {
114iLocalDef iBool isJapanese_FontId(enum iFontId id) { 114iLocalDef iBool isJapanese_FontId(enum iFontId id) {
115 return id >= defaultJapanese_FontId && id <= hugeJapanese_FontId; 115 return id >= defaultJapanese_FontId && id <= hugeJapanese_FontId;
116} 116}
117iLocalDef iBool isVariationSelector_Char(iChar ch) { 117iLocalDef iBool isVariationSelector_Char(iChar c) {
118 return ch >= 0xfe00 && ch <= 0xfe0f; 118 return (c >= 0xfe00 && c <= 0xfe0f) || (c >= 0xe0100 && c <= 0xe0121);
119}
120iLocalDef iBool isFitzpatrickType_Char(iChar c) {
121 return c >= 0x1f3fb && c <= 0x1f3ff;
122}
123iLocalDef iBool isDefaultIgnorable_Char(iChar c) {
124 return c == 0x115f || (c >= 0x200b && c <= 0x200e) || c == 0x2060 || c == 0x2061 ||
125 c == 0xfeff;
126}
127iLocalDef 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
123enum iTextFont { 133enum iTextFont {
124 nunito_TextFont, 134 nunito_TextFont,