From: handa Date: Fri, 18 Nov 2005 10:47:32 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: REL-1-3-0~69 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=0788ea9c9a734c01813ea152d2d0e6b8551d328a;p=m17n%2Fm17n-lib.git *** empty log message *** --- diff --git a/src/ChangeLog b/src/ChangeLog index dc3dd83..ee5cc14 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2005-11-18 Kenichi Handa + + * font.c (mfont_list): Fix for the case that FONT is NULL. + + * draw.c (truncate_gstring): Be sure to truncate at + glapheme-cluster boundary. + 2005-11-11 Kenichi Handa * input.c (delete_surrounding_text): Clear cache if necessary. diff --git a/src/fontset.c b/src/fontset.c index c83083e..8830461 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -328,6 +328,13 @@ realize_fontset_elements (MFrame *frame, MRealizedFontset *realized) font_group = mplist_add (font_group, MPLIST_KEY (p), MPLIST_VAL (p)); } + +/* Return a plist of fonts for SCRIPT in FONTSET. The returned list + is acutally a plist of languages vs font groups (which is a plist). + If SCRIPT is nil, return a plist of fallback fonts. If FONTSET + doesn't record any fonts for SCRIPT, generate a proper font spec + lists for X backend and FreeType backend. */ + MPlist * get_per_script (MFontset *fontset, MSymbol script) { @@ -625,6 +632,7 @@ try_font_group (MRealizedFontset *realized, MFont *request, font = MPLIST_VAL (plist); if (font->type == MFONT_TYPE_SPEC) { + /* We have not yet made this entry a MFontList. */ if (realized->spec) { MFont this = *font; @@ -640,6 +648,8 @@ try_font_group (MRealizedFontset *realized, MFont *request, font_list = mfont__list (frame, font, request, size); if (! font_list) { + /* As there's no font matching this spec, remove this + element from the font group. */ mplist_pop (plist); continue; } @@ -741,6 +751,7 @@ mfont__lookup_fontset (MRealizedFontset *realized, MGlyph *g, int *num, if (! per_script) { per_script = mplist_copy (get_per_script (realized->fontset, script)); + /* PER_SCRIPT ::= (LANGUAGE:(LAYOUTER:FONT-SPEC ...) ...) */ MPLIST_DO (plist, per_script) MPLIST_VAL (plist) = mplist_copy (MPLIST_VAL (plist)); mplist_add (realized->per_script, script, per_script);