diff options
Diffstat (limited to 'src/text')
-rw-r--r-- | src/text/text.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/text/text.h b/src/text/text.h index 931227c..647a021 100644 --- a/src/text/text.h +++ b/src/text/text.h | |||
@@ -136,4 +136,24 @@ txt_draws(char *msg, size_t x, size_t y, size_t spacing, u8 clr) { | |||
136 | txt_draws(buf, x, y, s, c); \ | 136 | txt_draws(buf, x, y, s, c); \ |
137 | } | 137 | } |
138 | 138 | ||
139 | // Small font is located after the initial ASCII characters, and only supports | ||
140 | // lowercase characters. | ||
141 | // NOTE: Slow, we should do this with a LUT. | ||
142 | #define txt_drawf_small(msg, x, y, s, c, ...) \ | ||
143 | { \ | ||
144 | char buf[256] = {0}; \ | ||
145 | posprintf(buf, msg, ##__VA_ARGS__); \ | ||
146 | for (size_t i = 0; i < 256; i++) { \ | ||
147 | if (buf[i] == 0) { \ | ||
148 | break; \ | ||
149 | } \ | ||
150 | if (buf[i] < 'a') { \ | ||
151 | buf[i] += 16 * 6; \ | ||
152 | } else { \ | ||
153 | buf[i] += 16 * 4; \ | ||
154 | }\ | ||
155 | } \ | ||
156 | txt_draws(buf, x, y, s, c); \ | ||
157 | } | ||
158 | |||
139 | #endif // TEXT_H | 159 | #endif // TEXT_H |