summaryrefslogtreecommitdiff
path: root/src/ui/text.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/text.h')
-rw-r--r--src/ui/text.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/ui/text.h b/src/ui/text.h
index 6728bb62..5867a84b 100644
--- a/src/ui/text.h
+++ b/src/ui/text.h
@@ -127,7 +127,8 @@ iLocalDef iBool isDefaultIgnorable_Char(iChar c) {
127 c == 0xfeff; 127 c == 0xfeff;
128} 128}
129iLocalDef iBool isEmoji_Char(iChar c) { 129iLocalDef iBool isEmoji_Char(iChar c) {
130 return (c >= 0x1f300 && c < 0x1f700) || (c >= 0x1f900 && c <= 0x1f9ff); 130 return (c >= 0x1f300 && c < 0x1f700) || (c >= 0x1f7e0 && c <= 0x1f7eb) ||
131 (c >= 0x1f900 && c <= 0x1f9ff);
131} 132}
132 133
133#define emojiVariationSelector_Char ((iChar) 0xfe0f) 134#define emojiVariationSelector_Char ((iChar) 0xfe0f)
@@ -141,21 +142,21 @@ enum iTextFont {
141 142
142extern int gap_Text; /* affected by content font size */ 143extern int gap_Text; /* affected by content font size */
143 144
144void init_Text (SDL_Renderer *); 145void init_Text (SDL_Renderer *);
145void deinit_Text (void); 146void deinit_Text (void);
146 147
147void setContentFont_Text (enum iTextFont font); 148void setContentFont_Text (enum iTextFont font);
148void setHeadingFont_Text (enum iTextFont font); 149void setHeadingFont_Text (enum iTextFont font);
149void setContentFontSize_Text (float fontSizeFactor); /* affects all except `default*` fonts */ 150void setContentFontSize_Text (float fontSizeFactor); /* affects all except `default*` fonts */
150void resetFonts_Text (void); 151void resetFonts_Text (void);
151 152
152int lineHeight_Text (int fontId); 153int lineHeight_Text (int fontId);
153iInt2 measure_Text (int fontId, const char *text); 154iInt2 measure_Text (int fontId, const char *text);
154iInt2 measureRange_Text (int fontId, iRangecc text); 155iInt2 measureRange_Text (int fontId, iRangecc text);
155iRect visualBounds_Text (int fontId, iRangecc text); 156iRect visualBounds_Text (int fontId, iRangecc text);
156iInt2 advance_Text (int fontId, const char *text); 157iInt2 advance_Text (int fontId, const char *text);
157iInt2 advanceN_Text (int fontId, const char *text, size_t n); /* `n` in characters */ 158iInt2 advanceN_Text (int fontId, const char *text, size_t n); /* `n` in characters */
158iInt2 advanceRange_Text (int fontId, iRangecc text); 159iInt2 advanceRange_Text (int fontId, iRangecc text);
159iInt2 advanceWrapRange_Text (int fontId, int maxWidth, iRangecc text); 160iInt2 advanceWrapRange_Text (int fontId, int maxWidth, iRangecc text);
160 161
161iInt2 tryAdvance_Text (int fontId, iRangecc text, int width, const char **endPos); 162iInt2 tryAdvance_Text (int fontId, iRangecc text, int width, const char **endPos);