From 4c136a0dace151ed8a5f22e3d5adafa8c1fd6677 Mon Sep 17 00:00:00 2001 From: Albert Cahalan Date: Thu, 6 Jan 2005 05:17:04 +0000 Subject: [PATCH] black means bold, for now --- src/tuxpaint.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 99b5d8181..7b21fd4ea 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -1562,13 +1562,18 @@ static int compar_fontscore(const void *v1, const void *v2) return f2->score - f1->score; } - +// Font style names are a mess that we must try to make +// sense of. For example... +// +// Cooper: Light, Medium, Light Bold, Black +// HoeflerText: (nil), Black static void parse_font_style(style_info *si) { int have_light = 0; int have_demi = 0; int have_bold = 0; int have_medium = 0; + int have_black = 0; si->italic = 0; @@ -1582,6 +1587,12 @@ static void parse_font_style(style_info *si) sp++; continue; } + if(!strncmp(sp,"Black",strlen("Black"))) + { + sp += strlen("Black"); + have_black = 1; + continue; + } if(!strncmp(sp,"Bold",strlen("Bold"))) { sp += strlen("Bold"); @@ -1661,7 +1672,7 @@ static void parse_font_style(style_info *si) if (have_demi || have_medium) si->boldness = 2; - else if (have_bold) + else if (have_bold || have_black) // TODO: black should be a level above si->boldness = 3; else if (have_light) si->boldness = 0; @@ -14104,7 +14115,7 @@ static void loadfonts(const char * const dir, int fatal) // 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")) { -printf("Loading font: %s/%s\n", dir, d_names[i]); +//printf("Loading font: %s/%s\n", dir, d_names[i]); TTF_Font *font = TTF_OpenFont(fname, text_sizes[text_size]); if(font) {