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.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ui/text.h b/src/ui/text.h
index 71c2ba43..fa7b9402 100644
--- a/src/ui/text.h
+++ b/src/ui/text.h
@@ -105,13 +105,19 @@ iLocalDef iBool isVariationSelector_Char(iChar ch) {
105 105
106#define variationSelectorEmoji_Char ((iChar) 0xfe0f) 106#define variationSelectorEmoji_Char ((iChar) 0xfe0f)
107 107
108enum iTextFont {
109 nunito_TextFont,
110 firaSans_TextFont,
111};
112
108extern int gap_Text; /* affected by content font size */ 113extern int gap_Text; /* affected by content font size */
109 114
110void init_Text (SDL_Renderer *); 115void init_Text (SDL_Renderer *);
111void deinit_Text (void); 116void deinit_Text (void);
112 117
118void setContentFont_Text (enum iTextFont font);
113void setContentFontSize_Text (float fontSizeFactor); /* affects all except `default*` fonts */ 119void setContentFontSize_Text (float fontSizeFactor); /* affects all except `default*` fonts */
114void resetFonts_Text (void); 120void resetFonts_Text (void);
115 121
116int lineHeight_Text (int fontId); 122int lineHeight_Text (int fontId);
117iInt2 measure_Text (int fontId, const char *text); 123iInt2 measure_Text (int fontId, const char *text);
@@ -120,6 +126,7 @@ iRect visualBounds_Text (int fontId, iRangecc text);
120iInt2 advance_Text (int fontId, const char *text); 126iInt2 advance_Text (int fontId, const char *text);
121iInt2 advanceN_Text (int fontId, const char *text, size_t n); /* `n` in characters */ 127iInt2 advanceN_Text (int fontId, const char *text, size_t n); /* `n` in characters */
122iInt2 advanceRange_Text (int fontId, iRangecc text); 128iInt2 advanceRange_Text (int fontId, iRangecc text);
129iInt2 advanceWrapRange_Text (int fontId, int maxWidth, iRangecc text);
123 130
124iInt2 tryAdvance_Text (int fontId, iRangecc text, int width, const char **endPos); 131iInt2 tryAdvance_Text (int fontId, iRangecc text, int width, const char **endPos);
125iInt2 tryAdvanceNoWrap_Text (int fontId, iRangecc text, int width, const char **endPos); 132iInt2 tryAdvanceNoWrap_Text (int fontId, iRangecc text, int width, const char **endPos);
@@ -137,6 +144,7 @@ void drawAlign_Text (int fontId, iInt2 pos, int color, enum iAlignment a
137void drawCentered_Text (int fontId, iRect rect, iBool alignVisual, int color, const char *text, ...); 144void drawCentered_Text (int fontId, iRect rect, iBool alignVisual, int color, const char *text, ...);
138void drawString_Text (int fontId, iInt2 pos, int color, const iString *text); 145void drawString_Text (int fontId, iInt2 pos, int color, const iString *text);
139void drawRange_Text (int fontId, iInt2 pos, int color, iRangecc text); 146void drawRange_Text (int fontId, iInt2 pos, int color, iRangecc text);
147int drawWrapRange_Text (int fontId, iInt2 pos, int maxWidth, int color, iRangecc text); /* returns new Y */
140 148
141SDL_Texture * glyphCache_Text (void); 149SDL_Texture * glyphCache_Text (void);
142 150