From: handa Date: Fri, 9 Nov 2007 01:19:15 +0000 (+0000) Subject: (try_font_list): Check if the named flt is surely X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=a5fcb427c5fa7d34d9bfb35fb88d376a789013cc;p=m17n%2Fm17n-lib.git (try_font_list): Check if the named flt is surely available. --- diff --git a/src/fontset.c b/src/fontset.c index 35ea765..7a431f3 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -585,9 +585,10 @@ try_font_list (MFrame *frame, MFontList *font_list, MFont *request, MCharTable *coverage; if (layouter != Mt - ? (flt = mflt_get (layouter), - coverage = mflt_coverage (flt), - ! mchartable_lookup (coverage, c)) + ? ((flt = mflt_get (layouter)) + ? (coverage = mflt_coverage (flt), + ! mchartable_lookup (coverage, c)) + : 0) : ! mfont__has_char (frame, font, &font_list->object, c)) break; } @@ -595,7 +596,6 @@ try_font_list (MFrame *frame, MFontList *font_list, MFont *request, continue; if (j == *num || !all) { - MFLT *ftl; MCharTable *coverage = NULL; /* We found a font that can display the requested range of @@ -611,14 +611,19 @@ try_font_list (MFrame *frame, MFontList *font_list, MFont *request, } rfont->layouter = layouter == Mt ? Mnil : layouter; if (rfont->layouter) - coverage = mflt_coverage (mflt_get (rfont->layouter)); + { + MFLT *flt = mflt_get (rfont->layouter); + + if (flt) + coverage = mflt_coverage (flt); + } *num = j; for (j = 0; j < *num; j++) { int c = g[j].type == GLYPH_CHAR ? g[j].g.c : ' '; - g[j].g.code = (rfont->layouter - ? mchartable_lookup (coverage, c) + g[j].g.code = (coverage + ? (unsigned ) mchartable_lookup (coverage, c) : mfont__encode_char (frame, (MFont *) rfont, &font_list->object, c)); }