diff options
Diffstat (limited to 'textscreen/txt_gui.c')
-rw-r--r-- | textscreen/txt_gui.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/textscreen/txt_gui.c b/textscreen/txt_gui.c index 1a5275b6..74e3ec75 100644 --- a/textscreen/txt_gui.c +++ b/textscreen/txt_gui.c @@ -322,6 +322,29 @@ static void PutUnicodeChar(unsigned int c) TXT_PutChar('\xa8'); } +int TXT_CanDrawCharacter(unsigned int c) +{ + unsigned int i; + + // Standard ASCII range? + if (c < 128) + { + return 1; + } + + // Extended ASCII range? + for (i = 0; i < 128; ++i) + { + if (cp437_unicode[i] == c) + { + return 1; + } + } + + // Nope. + return 0; +} + void TXT_DrawUTF8String(const char *s) { int x, y; |