]> git.pld-linux.org Git - packages/fontconfig.git/commitdiff
patch to fix constant (non-ranged) weight in font pattern; rel 2 auto/th/fontconfig-2.13.0-2
authorJan Palus <atler@pld-linux.org>
Sat, 10 Mar 2018 12:00:55 +0000 (13:00 +0100)
committerJan Palus <atler@pld-linux.org>
Sat, 10 Mar 2018 12:02:34 +0000 (13:02 +0100)
see https://bugs.freedesktop.org/show_bug.cgi?id=105415

fontconfig-constant-weight.patch [new file with mode: 0644]
fontconfig.spec

diff --git a/fontconfig-constant-weight.patch b/fontconfig-constant-weight.patch
new file mode 100644 (file)
index 0000000..1d558c3
--- /dev/null
@@ -0,0 +1,46 @@
+diff --git a/src/fcname.c b/src/fcname.c
+index 79e413e..2172d70 100644
+--- a/src/fcname.c
++++ b/src/fcname.c
+@@ -330,13 +330,36 @@ FcNameConvert (FcType type, FcChar8 *string)
+     case FcTypeRange:
+       if (sscanf ((char *) string, "[%lg %lg]", &b, &e) != 2)
+       {
+-          v.u.d = strtod ((char *) string, &p);
+-          if (p != NULL && p[0] != 0)
++          char *sc, *ec;
++          size_t len = strlen ((const char *) string);
++          int si, ei;
++
++          sc = malloc (len);
++          ec = malloc (len);
++          if (sc && ec && sscanf ((char *) string, "[%s %[^]]]", sc, ec) == 2)
+           {
+-              v.type = FcTypeVoid;
+-              break;
++              if (FcNameConstant ((const FcChar8 *) sc, &si) && FcNameConstant ((const FcChar8 *) ec, &ei))
++                  v.u.r =  FcRangeCreateDouble (si, ei);
++              else
++                  goto bail1;
++          }
++          else
++          {
++          bail1:
++              v.type = FcTypeDouble;
++              if (FcNameConstant (string, &si))
++              {
++                  v.u.d = (double) si;
++              } else {
++                  v.u.d = strtod ((char *) string, &p);
++                  if (p != NULL && p[0] != 0)
++                      v.type = FcTypeVoid;
++              }
+           }
+-          v.type = FcTypeDouble;
++          if (sc)
++              free (sc);
++          if (ec)
++              free (ec);
+       }
+       else
+           v.u.r = FcRangeCreateDouble (b, e);
index b842ce54492a44bd977fb9585897727faab50272..8e3b1819c87b1bbbfed4b89697a35e5669d1c79c 100644 (file)
@@ -9,7 +9,7 @@ Summary(pl.UTF-8):      Narzędzia do konfigurowania fontów
 Summary(pt_BR.UTF-8):  Ferramentas para configuração e customização do acesso a fontes
 Name:          fontconfig
 Version:       2.13.0
-Release:       1
+Release:       2
 Epoch:         1
 License:       MIT
 Group:         Libraries
@@ -17,6 +17,7 @@ Source0:      https://www.freedesktop.org/software/fontconfig/release/%{name}-%{versi
 # Source0-md5: 60d2394a79d3b2e5db2daea55193fa47
 Source1:       %{name}-lcd-filter.conf
 Patch0:                %{name}-bitstream-cyberbit.patch
+Patch1:                %{name}-constant-weight.patch
 URL:           http://fontconfig.org/
 BuildRequires: autoconf >= 2.61
 BuildRequires: automake >= 1:1.11
@@ -129,6 +130,7 @@ Este pacote contém a biblioteca estática do fontconfig
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %{__gettextize}
This page took 0.131228 seconds and 4 git commands to generate.