aboutsummaryrefslogtreecommitdiffstats
path: root/fbtruetype/ttf.c
diff options
context:
space:
mode:
authorPablo Saratxaga <pablo@mandriva.com>2003-08-16 21:58:02 +0000
committerPablo Saratxaga <pablo@mandriva.com>2003-08-16 21:58:02 +0000
commit3a9fcbedda7e7b10d6f5b0a2fd9ed873b2a70cdb (patch)
treea54d8fb9241c5bbecd5f5811b6d58b782e8d1254 /fbtruetype/ttf.c
parenta36e42522db0327580ae246a65dc1ddc61b600ca (diff)
downloadbootsplash-3a9fcbedda7e7b10d6f5b0a2fd9ed873b2a70cdb.tar
bootsplash-3a9fcbedda7e7b10d6f5b0a2fd9ed873b2a70cdb.tar.gz
bootsplash-3a9fcbedda7e7b10d6f5b0a2fd9ed873b2a70cdb.tar.bz2
bootsplash-3a9fcbedda7e7b10d6f5b0a2fd9ed873b2a70cdb.tar.xz
bootsplash-3a9fcbedda7e7b10d6f5b0a2fd9ed873b2a70cdb.zip
Added real i18n support (different fonts possible, depending on language)
Diffstat (limited to 'fbtruetype/ttf.c')
-rw-r--r--fbtruetype/ttf.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fbtruetype/ttf.c b/fbtruetype/ttf.c
index 61ee3b0..2c64121 100644
--- a/fbtruetype/ttf.c
+++ b/fbtruetype/ttf.c
@@ -114,7 +114,6 @@ static unsigned short *ASCII_to_UNICODE(unsigned short *unicode, const char *tex
return unicode;
}
-#if 0
static unsigned short *UTF8_to_UNICODE(unsigned short *unicode, const char *utf8, int len)
{
int i, j;
@@ -143,7 +142,6 @@ static unsigned short *UTF8_to_UNICODE(unsigned short *unicode, const char *utf8
return unicode;
}
-#endif
/* TTF stuff */
@@ -182,14 +180,14 @@ 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));
if ( unicode_text == NULL ) {
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);
@@ -208,7 +206,7 @@ unsigned char*TTF_RenderText_Shaded(TTF_Font *font, const char *text, unsigned i
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)*(sizeof
*unicode_text));
@@ -216,7 +214,7 @@ unsigned char*TTF_RenderText_Shaded(TTF_Font *font, const char *text, unsigned i
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);
@@ -762,7 +760,7 @@ int rendertext(char *text, char *fontname, unsigned int ptsize, unsigned int for
}
renderstyle = TTF_STYLE_NORMAL;
- rendertype = RENDER_LATIN1;
+ rendertype = RENDER_UTF8;
TTF_SetFontStyle(font, renderstyle);
text = TTF_RenderText_Shaded(font, text, forecol, 0);