From 057b667e9286ce90f8eb1d7614bd87453fc1df32 Mon Sep 17 00:00:00 2001 From: Pablo Saratxaga Date: Thu, 30 Sep 2004 10:17:25 +0000 Subject: - enabled back use of UTF-8 for fbtruetype - checked and improved the fonts to use for the various languages --- fbtruetype/ttf.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'fbtruetype/ttf.c') 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); -- cgit v1.2.1