From def0af0e4b552d20b9980e3645332867a31bceda Mon Sep 17 00:00:00 2001 From: Albert Cahalan Date: Fri, 7 Jan 2005 21:27:09 +0000 Subject: [PATCH] prefer to fake italic over faking bold --- src/tuxpaint.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 192994162..8394963a3 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -1499,13 +1499,13 @@ static TTF_Font *getfonthandle(int desire) char *name = fi->filename[text_state]; if(!name) { - name = fi->filename[text_state ^ TTF_STYLE_BOLD]; - missing = text_state & TTF_STYLE_BOLD; + name = fi->filename[text_state ^ TTF_STYLE_ITALIC]; + missing = text_state & TTF_STYLE_ITALIC; } if(!name) { - name = fi->filename[text_state ^ TTF_STYLE_ITALIC]; - missing = text_state & TTF_STYLE_ITALIC; + name = fi->filename[text_state ^ TTF_STYLE_BOLD]; + missing = text_state & TTF_STYLE_BOLD; } if(!name) { @@ -1816,6 +1816,24 @@ printf(" %s\n", base[i]->style); fi->filename[spot] = strdup(base[i]->filename); fi->score += 2; } + if(!fi->filename[0] && !fi->filename[1]) + { + fi->filename[0] = fi->filename[2]; + fi->filename[2] = NULL; + fi->filename[1] = fi->filename[3]; + fi->filename[3] = NULL; + } + if(!fi->filename[0] && !fi->filename[2]) + { + fi->filename[0] = fi->filename[1]; + fi->filename[1] = NULL; + fi->filename[2] = fi->filename[3]; + fi->filename[3] = NULL; + } + if(!fi->filename[0]) + { + fi->filename[0] = strdup(fi->filename[TTF_STYLE_BOLD]); + } }