Began adding support for using SDL_Pango, a wrapper to Pango,
a library for layout and rendering of text, with an emphasis on internationalization. (The hope is to improve support for languages that SDL_ttf doesn't support well; e.g., Arabic and Telegu.) TTF_Font structs and some functions were replaced by a new TuxPaint_Font struct and function, which wraps around either TTF_Font or SDLPango_Context, depending on whether SDL_Pango is being used. Note: STILL NEEDS WORK!
This commit is contained in:
parent
516d913692
commit
095ba8efb3
6 changed files with 338 additions and 55 deletions
|
|
@ -30,6 +30,10 @@
|
|||
void loadfont_callback(SDL_Surface * screen, const char *restrict const dir,
|
||||
unsigned dirlen, tp_ftw_str * files, unsigned i)
|
||||
{
|
||||
/* FIXME */
|
||||
|
||||
#ifdef NO_SDLPANGO
|
||||
|
||||
dirlen = dirlen;
|
||||
|
||||
while (i--)
|
||||
|
|
@ -65,14 +69,14 @@ void loadfont_callback(SDL_Surface * screen, const char *restrict const dir,
|
|||
if (loadable)
|
||||
{
|
||||
char fname[512];
|
||||
TTF_Font *font;
|
||||
TuxPaint_Font *font;
|
||||
snprintf(fname, sizeof fname, "%s/%s", dir, files[i].str);
|
||||
//printf("Loading font: %s\n", fname);
|
||||
font = TTF_OpenFont(fname, text_sizes[text_size]);
|
||||
font = TuxPaint_Font_OpenFont("", fname, text_sizes[text_size]);
|
||||
if (font)
|
||||
{
|
||||
const char *restrict const family = TTF_FontFaceFamilyName(font);
|
||||
const char *restrict const style = TTF_FontFaceStyleName(font);
|
||||
const char *restrict const family = TuxPaint_Font_FontFaceFamilyName(font);
|
||||
const char *restrict const style = TuxPaint_Font_FontFaceStyleName(font);
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
@ -149,6 +153,9 @@ void loadfont_callback(SDL_Surface * screen, const char *restrict const dir,
|
|||
free(files[i].str);
|
||||
}
|
||||
free(files);
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue