[Fontconfig] Re: patch: fallback to POSIX if LC_CTYPE is the empty string "".

Mike FABIAN mfabian at suse.de
Wed Aug 17 03:30:37 EST 2005


Keith Packard <keithp at keithp.com> さんは書きました:

> On Tue, 2005-08-16 at 18:02 +0200, Mike FABIAN wrote:

[...]

>> Although setting LC_CTYPE="" is not a valid setting in my opinion, I
>> think fontconfig should fall back to matching an English font in that
>> case, just as it does for all the other invalid settings of LC_CTYPE.
>
> It should probably treat an empty lang as if the lang was not set:
>
> Index: fcdefault.c
> ===================================================================
> RCS file: /cvs/fontconfig/fontconfig/src/fcdefault.c,v
> retrieving revision 1.7
> diff -u -p -r1.7 fcdefault.c
> --- fcdefault.c 7 Dec 2004 01:14:46 -0000       1.7
> +++ fcdefault.c 16 Aug 2005 17:06:46 -0000
> @@ -111,7 +111,8 @@ FcDefaultSubstitute (FcPattern *pattern)
>                     ctype = getenv ("LANG");
>             }
>         }
> -       if (ctype)
> +       /* ignore missing or empty ctype */
> +       if (ctype && *ctype != '\0')
>         {
>             lang = ctype;
>             territory = strchr (ctype, '_');
>
> There's no point setting ctype to 'POSIX'; the only ctypes which have
> any effect on the library are those in <lang>_<territory> form.

Thank you, that works as well.

-- 
Mike FABIAN   <mfabian at suse.de>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。




More information about the Fontconfig mailing list