aboutsummaryrefslogtreecommitdiffstats
path: root/fbtruetype/ttf.c
diff options
context:
space:
mode:
Diffstat (limited to 'fbtruetype/ttf.c')
-rw-r--r--fbtruetype/ttf.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fbtruetype/ttf.c b/fbtruetype/ttf.c
index 4e16f17..edc2bf0 100644
--- a/fbtruetype/ttf.c
+++ b/fbtruetype/ttf.c
@@ -115,7 +115,6 @@ static unsigned short *ASCII_to_UNICODE(unsigned short *unicode,
return unicode;
}
-#if 0
static unsigned short *UTF8_to_UNICODE(unsigned short *unicode,
const char *utf8, int len)
{
@@ -143,7 +142,6 @@ static unsigned short *UTF8_to_UNICODE(unsigned short *unicode,
return unicode;
}
-#endif
/* TTF stuff */
@@ -183,7 +181,7 @@ SDL_Surface *TTF_RenderText_Solid(TTF_Font * font,
Uint16 *unicode_text;
int unicode_len;
- /* Copy the Latin-1 text to a UNICODE text buffer */
+ /* Copy the UTF-8 text to a UNICODE text buffer */
unicode_len = strlen(text);
unicode_text =
(Uint16 *) malloc((unicode_len + 1) * (sizeof *unicode_text));
@@ -191,7 +189,7 @@ SDL_Surface *TTF_RenderText_Solid(TTF_Font * font,
TTF_SetError("Out of memory");
return (NULL);
}
- ASCII_to_UNICODE(unicode_text, text, unicode_len);
+ UTF8_to_UNICODE(unicode_text, text, unicode_len);
RenderUnicode(font, unicode_text, fg);
@@ -211,7 +209,7 @@ unsigned char *TTF_RenderText_Shaded(TTF_Font * font, const char *text,
unsigned short *unicode_text;
int unicode_len;
- /* Copy the Latin-1 text to a UNICODE text buffer */
+ /* Copy the UTF-8 text to a UNICODE text buffer */
unicode_len = strlen(text);
unicode_text =
(unsigned short *) malloc((unicode_len + 1) *
@@ -220,7 +218,7 @@ unsigned char *TTF_RenderText_Shaded(TTF_Font * font, const char *text,
printf("Out of memory\n");
return (NULL);
}
- ASCII_to_UNICODE(unicode_text, text, unicode_len);
+ UTF8_to_UNICODE(unicode_text, text, unicode_len);
/* Render the new text */
textbuf = TTF_RenderUNICODE_Shaded(font, unicode_text, fg, bg);