aboutsummaryrefslogtreecommitdiffstats
path: root/fbtruetype/ttf.c
diff options
context:
space:
mode:
authorPablo Saratxaga <pablo@mandriva.com>2004-09-30 10:17:25 +0000
committerPablo Saratxaga <pablo@mandriva.com>2004-09-30 10:17:25 +0000
commit057b667e9286ce90f8eb1d7614bd87453fc1df32 (patch)
tree7367b6067737d27eedae39fa7aa9e90920aab6a2 /fbtruetype/ttf.c
parent2be2617e11cc58733350907aa6c9f7602df1d56a (diff)
downloadbootsplash-057b667e9286ce90f8eb1d7614bd87453fc1df32.tar
bootsplash-057b667e9286ce90f8eb1d7614bd87453fc1df32.tar.gz
bootsplash-057b667e9286ce90f8eb1d7614bd87453fc1df32.tar.bz2
bootsplash-057b667e9286ce90f8eb1d7614bd87453fc1df32.tar.xz
bootsplash-057b667e9286ce90f8eb1d7614bd87453fc1df32.zip
- enabled back use of UTF-8 for fbtruetype
- checked and improved the fonts to use for the various languages
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);