summaryrefslogtreecommitdiff
path: root/vlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'vlib.h')
-rw-r--r--vlib.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/vlib.h b/vlib.h
index 5140b83..b081806 100644
--- a/vlib.h
+++ b/vlib.h
@@ -12540,6 +12540,13 @@ V_DECL void gl_text_set(GLText *text, const char *str) {
float x = 0, y = 0;
for (i = 0; i < len; ++i) {
char c = str[i];
+ unsigned char uc = (unsigned char)c;
+ if (uc > static_arr_len(text_positions)) {
+ if (unicode_is_start_of_code_point(uc))
+ c = '?'; // one question mark per non-ASCII UTF-8 codepoint
+ else
+ continue;
+ }
if (c == '\n') {
x = 0;
y -= 1;