From: handa Date: Thu, 25 Aug 2005 01:21:35 +0000 (+0000) Subject: (xfont_registry_list): Set font.for_full_width if the X-Git-Tag: REL-1-3-0~228 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f6a9612b8b85e86291a78d068874cb40c4ebbfe;p=m17n%2Fm17n-lib.git (xfont_registry_list): Set font.for_full_width if the registry charset of a font is one of CJK charsets. --- diff --git a/src/m17n-X.c b/src/m17n-X.c index 2f86978..1170067 100644 --- a/src/m17n-X.c +++ b/src/m17n-X.c @@ -462,6 +462,7 @@ xfont_registry_list (MFrame *frame, MSymbol registry) int nfonts; int i, j; MFont font; + int for_full_width; plist = mplist_get (font_list, registry); if (plist) @@ -472,6 +473,14 @@ xfont_registry_list (MFrame *frame, MSymbol registry) font_names = XListFonts (disp_info->display, pattern, 0x8000, &nfonts); if (nfonts == 0) return plist; + { + char *reg_name = msymbol_name (registry); + + for_full_width = (strncmp (reg_name, "jis", 3) == 0 + || strncmp (reg_name, "gb", 2) == 0 + || strncmp (reg_name, "big5", 4) == 0 + || strncmp (reg_name, "ksc", 3) == 0); + } names = alloca (sizeof (char *) * nfonts); memcpy (names, font_names, sizeof (char *) * nfonts); qsort (names, nfonts, sizeof (char *), font_compare); @@ -516,6 +525,7 @@ xfont_registry_list (MFrame *frame, MSymbol registry) sizes[nsizes++] = size; } + font.for_full_width = for_full_width; font.type = MFONT_TYPE_OBJECT; font.source = MFONT_SOURCE_X; MSTRUCT_CALLOC (fontx, MERROR_WIN);