From: handa Date: Mon, 29 Oct 2007 02:19:37 +0000 (+0000) Subject: (try_font_list): Adusted for the change of MGlyph. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=15d7597794f18257d75e48fcc73aa90ac2c1a4ca;p=m17n%2Fm17n-lib.git (try_font_list): Adusted for the change of MGlyph. --- diff --git a/src/fontset.c b/src/fontset.c index 917cb44..35ea765 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -580,9 +580,14 @@ try_font_list (MFrame *frame, MFontList *font_list, MFont *request, /* Check if this font can display all glyphs. */ for (j = 0; j < *num; j++) { - int c = g[j].type == GLYPH_CHAR ? g[j].c : ' '; + int c = g[j].type == GLYPH_CHAR ? g[j].g.c : ' '; + MFLT *flt; + MCharTable *coverage; + if (layouter != Mt - ? mfont__flt_encode_char (layouter, c) == MCHAR_INVALID_CODE + ? (flt = mflt_get (layouter), + coverage = mflt_coverage (flt), + ! mchartable_lookup (coverage, c)) : ! mfont__has_char (frame, font, &font_list->object, c)) break; } @@ -590,6 +595,9 @@ 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 glyphs. */ if (font->type == MFONT_TYPE_REALIZED) @@ -602,15 +610,17 @@ try_font_list (MFrame *frame, MFontList *font_list, MFont *request, font_list->fonts[i].font = (MFont *) rfont; } rfont->layouter = layouter == Mt ? Mnil : layouter; + if (rfont->layouter) + coverage = mflt_coverage (mflt_get (rfont->layouter)); *num = j; for (j = 0; j < *num; j++) { - int c = g[j].type == GLYPH_CHAR ? g[j].c : ' '; + int c = g[j].type == GLYPH_CHAR ? g[j].g.c : ' '; - g[j].code = (rfont->layouter - ? mfont__flt_encode_char (rfont->layouter, c) - : mfont__encode_char (frame, (MFont *) rfont, - &font_list->object, c)); + g[j].g.code = (rfont->layouter + ? mchartable_lookup (coverage, c) + : mfont__encode_char (frame, (MFont *) rfont, + &font_list->object, c)); } return rfont; }