diff options
Diffstat (limited to 'src/ui/text.h')
-rw-r--r-- | src/ui/text.h | 10 |
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 | ||
108 | enum iTextFont { | ||
109 | nunito_TextFont, | ||
110 | firaSans_TextFont, | ||
111 | }; | ||
112 | |||
108 | extern int gap_Text; /* affected by content font size */ | 113 | extern int gap_Text; /* affected by content font size */ |
109 | 114 | ||
110 | void init_Text (SDL_Renderer *); | 115 | void init_Text (SDL_Renderer *); |
111 | void deinit_Text (void); | 116 | void deinit_Text (void); |
112 | 117 | ||
118 | void setContentFont_Text (enum iTextFont font); | ||
113 | void setContentFontSize_Text (float fontSizeFactor); /* affects all except `default*` fonts */ | 119 | void setContentFontSize_Text (float fontSizeFactor); /* affects all except `default*` fonts */ |
114 | void resetFonts_Text (void); | 120 | void resetFonts_Text (void); |
115 | 121 | ||
116 | int lineHeight_Text (int fontId); | 122 | int lineHeight_Text (int fontId); |
117 | iInt2 measure_Text (int fontId, const char *text); | 123 | iInt2 measure_Text (int fontId, const char *text); |
@@ -120,6 +126,7 @@ iRect visualBounds_Text (int fontId, iRangecc text); | |||
120 | iInt2 advance_Text (int fontId, const char *text); | 126 | iInt2 advance_Text (int fontId, const char *text); |
121 | iInt2 advanceN_Text (int fontId, const char *text, size_t n); /* `n` in characters */ | 127 | iInt2 advanceN_Text (int fontId, const char *text, size_t n); /* `n` in characters */ |
122 | iInt2 advanceRange_Text (int fontId, iRangecc text); | 128 | iInt2 advanceRange_Text (int fontId, iRangecc text); |
129 | iInt2 advanceWrapRange_Text (int fontId, int maxWidth, iRangecc text); | ||
123 | 130 | ||
124 | iInt2 tryAdvance_Text (int fontId, iRangecc text, int width, const char **endPos); | 131 | iInt2 tryAdvance_Text (int fontId, iRangecc text, int width, const char **endPos); |
125 | iInt2 tryAdvanceNoWrap_Text (int fontId, iRangecc text, int width, const char **endPos); | 132 | iInt2 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 | |||
137 | void drawCentered_Text (int fontId, iRect rect, iBool alignVisual, int color, const char *text, ...); | 144 | void drawCentered_Text (int fontId, iRect rect, iBool alignVisual, int color, const char *text, ...); |
138 | void drawString_Text (int fontId, iInt2 pos, int color, const iString *text); | 145 | void drawString_Text (int fontId, iInt2 pos, int color, const iString *text); |
139 | void drawRange_Text (int fontId, iInt2 pos, int color, iRangecc text); | 146 | void drawRange_Text (int fontId, iInt2 pos, int color, iRangecc text); |
147 | int drawWrapRange_Text (int fontId, iInt2 pos, int maxWidth, int color, iRangecc text); /* returns new Y */ | ||
140 | 148 | ||
141 | SDL_Texture * glyphCache_Text (void); | 149 | SDL_Texture * glyphCache_Text (void); |
142 | 150 | ||