From d02db87871e8202692a450c9aa8efbe6ee2c8706 Mon Sep 17 00:00:00 2001 From: Albert Cahalan Date: Thu, 6 Jan 2005 05:37:21 +0000 Subject: [PATCH] support OpenType fonts too --- src/tuxpaint.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 7b21fd4ea..1e03992f2 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -1679,7 +1679,8 @@ static void parse_font_style(style_info *si) else si->boldness = 1; - si->truetype = !!strstr(si->filename,".ttf"); + // we'll count both TrueType and OpenType + si->truetype = !!strstr(si->filename,".ttf") || !!strstr(si->filename,".otf"); } static void groupfonts_range(style_info **base, int count) @@ -14111,9 +14112,10 @@ static void loadfonts(const char * const dir, int fatal) if (S_ISDIR(sbuf.st_mode)) loadfonts(fname,fatal); - // Loadable: TrueType (.ttf), Type1 (.pfa and .pfb), and various useless bitmap fonts. - // Compressed files (with .gz or .bz2) might also work. - if (strstr(d_names[i], ".ttf") || strstr(d_names[i], ".pfa") || strstr(d_names[i], ".pfb")) + // Loadable: TrueType (.ttf), OpenType (.otf), Type1 (.pfa and .pfb), + // and various useless bitmap fonts. Compressed files (with .gz or .bz2) + // should also work. + if (strstr(d_names[i], ".ttf") || strstr(d_names[i], ".otf") || strstr(d_names[i], ".pfa") || strstr(d_names[i], ".pfb")) { //printf("Loading font: %s/%s\n", dir, d_names[i]); TTF_Font *font = TTF_OpenFont(fname, text_sizes[text_size]);