diff options
author | Koop Mast <kwm@FreeBSD.org> | 2015-11-02 13:41:03 +0000 |
---|---|---|
committer | Koop Mast <kwm@FreeBSD.org> | 2015-11-02 13:41:03 +0000 |
commit | 022cafac8f76f9f758af6d690b700730e3852a7d (patch) | |
tree | e5ec890a847ca29179d76fa4197b5a72a6f88863 /x11-fonts | |
parent | 8606beb1b8e2c5e7528606cf47afea9adbfa2193 (diff) | |
download | freebsd-ports-022cafac8f76f9f758af6d690b700730e3852a7d.zip |
Teach fontconfig that LANG and LC_* settings with more than 2 components
are fine and actualy supported by POSIX even if Linux doesn't.
This should fix font issues with the projects/collation branch.
Submitted by: bapt@, marino@
Obtained from: DragonFly BSD
Diffstat (limited to 'x11-fonts')
-rw-r--r-- | x11-fonts/fontconfig/Makefile | 3 | ||||
-rw-r--r-- | x11-fonts/fontconfig/files/patch-src_fclang.c | 50 |
2 files changed, 51 insertions, 2 deletions
diff --git a/x11-fonts/fontconfig/Makefile b/x11-fonts/fontconfig/Makefile index 84ba4a1b25ce..7ff19a61cc1f 100644 --- a/x11-fonts/fontconfig/Makefile +++ b/x11-fonts/fontconfig/Makefile @@ -1,10 +1,9 @@ # Created by: Joe Marcus Clarke <marcus@FreeBSD.org> # $FreeBSD$ -# $MCom: ports/trunk/x11-fonts/fontconfig/Makefile 18637 2013-07-27 09:15:21Z kwm $ PORTNAME= fontconfig PORTVERSION= 2.11.1 -PORTREVISION?= 0 +PORTREVISION?= 1 PORTEPOCH?= 1 CATEGORIES= x11-fonts MASTER_SITES= http://www.freedesktop.org/software/fontconfig/release/ diff --git a/x11-fonts/fontconfig/files/patch-src_fclang.c b/x11-fonts/fontconfig/files/patch-src_fclang.c new file mode 100644 index 000000000000..f6664827b457 --- /dev/null +++ b/x11-fonts/fontconfig/files/patch-src_fclang.c @@ -0,0 +1,50 @@ +--- src/fclang.c.orig 2014-01-20 08:14:20 UTC ++++ src/fclang.c +@@ -183,6 +183,7 @@ FcLangNormalize (const FcChar8 *lang) + { + FcChar8 *result = NULL, *s, *orig; + char *territory, *encoding, *modifier; ++ char *script; + size_t llen, tlen = 0, mlen = 0; + + if (!lang || !*lang) +@@ -241,26 +242,32 @@ FcLangNormalize (const FcChar8 *lang) + modifier = encoding; + } + } +- territory = strchr ((const char *) s, '_'); +- if (!territory) +- territory = strchr ((const char *) s, '-'); ++ territory = strrchr ((const char *) s, '_'); + if (territory) + { + *territory = 0; + territory++; + tlen = strlen (territory); + } ++ /* There might by a script component, e.g. sr_Cyrl_RS@UTF-8. We can't assume all legal locale ++ names are in the form <lang>_<country code>.<encoding>. If the script component is here, ++ skip it to define the language properly (e.g. "sr" instead of "sr_Cyrl") */ ++ script = strchr ((const char *) s, '_'); ++ if (script) ++ { ++ *script = 0; ++ } + llen = strlen ((const char *) s); + if (llen < 2 || llen > 3) + { +- fprintf (stderr, "Fontconfig warning: ignoring %s: not a valid language tag\n", +- lang); ++ fprintf (stderr, "Fontconfig warning: ignoring %s: not a valid language tag (%s)\n", ++ s, lang); + goto bail0; + } + if (territory && (tlen < 2 || tlen > 3)) + { +- fprintf (stderr, "Fontconfig warning: ignoring %s: not a valid region tag\n", +- lang); ++ fprintf (stderr, "Fontconfig warning: ignoring %s: not a valid region tag (%s)\n", ++ territory, lang); + goto bail0; + } + if (territory) |