From: handa Date: Fri, 19 Aug 2005 02:06:24 +0000 (+0000) Subject: (mfont_list): If FONT is null, use a temporary font. X-Git-Tag: REL-1-3-0~259 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=ebb9aa922a01d5052acee38d06d4b175086ba725;p=m17n%2Fm17n-lib.git (mfont_list): If FONT is null, use a temporary font. --- diff --git a/src/font.c b/src/font.c index 22aa0e9..4cecfbd 100644 --- a/src/font.c +++ b/src/font.c @@ -2666,6 +2666,7 @@ mfont_list (MFrame *frame, MFont *font, MSymbol language, int maxnum) MPlist *plist, *pl; MFontList *font_list; int i; + MFont *work = NULL; if (language != Mnil) { @@ -2673,10 +2674,14 @@ mfont_list (MFrame *frame, MFont *font, MSymbol language, int maxnum) char *buf = alloca (MSYMBOL_NAMELEN (language) + 7); sprintf (buf, ":lang=%s", MSYMBOL_NAME (language)); + if (! font) + font = work = mfont (); font->capability = msymbol (buf); } font_list = mfont__list (frame, font, font, 0); + if (work) + free (work); if (! font_list) return NULL; if (font_list->nfonts == 0)