Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=cc79ceaceac9d466fffd2148cc250591d5ef8c9e

commit cc79ceaceac9d466fffd2148cc250591d5ef8c9e
Author: Baste <[email protected]>
Date:   Mon Apr 22 12:07:49 2013 +0200

fontconfig-2.10.92-1-x86_64
* Version bump
* Change m8r

diff --git a/source/lib/fontconfig/FrugalBuild 
b/source/lib/fontconfig/FrugalBuild
index f85105f..f6a2c06 100644
--- a/source/lib/fontconfig/FrugalBuild
+++ b/source/lib/fontconfig/FrugalBuild
@@ -1,9 +1,12 @@
# Compiling time: 0.32 SBU
-# Maintainer: crazy <[email protected]>
+# Maintainer: Baste <[email protected]>
+# Contributor: crazy <[email protected]>
# Contributor: Miklos Vajna <[email protected]>

+options+=('asneeded')
+
pkgname=fontconfig
-pkgver=2.10.91
+pkgver=2.10.92
pkgrel=1
pkgdesc="A library for configuring and customizing font access"
url="http://fontconfig.org/";
@@ -12,7 +15,7 @@ groups=('lib' 'misc-fonts')
archs=('i686' 'x86_64' 'arm')
up2date="lynx -dump http://fontconfig.org/release|Flasttar"
options=('force')
-source=($url/release/$pkgname-$pkgver.tar.gz 25-no-bitmap.conf)
+source=($url/release/$pkgname-$pkgver.tar.gz 25-no-bitmap.conf git.patch 
fontconfig-fix.patch)
#       01-frugalware-confs.patch \
#       04-latin.conf-move-dejavu-and-luxi-before-vera-and-add-droid.patch)

@@ -27,6 +30,8 @@ build()
Fmakeinstall
Ffile 25-no-bitmap.conf etc/fonts/conf.d/
}
-sha1sums=('ad6f0b59a60717c71941a65d49e06a74d5205d29' \
-          '72ed9989eb96475b0c077dda2e47188583d63420')
+sha1sums=('8fb6f6f5d590a9397aa36ffa225c44dca4876e47' \
+          '72ed9989eb96475b0c077dda2e47188583d63420' \
+          '7018637713effff3cbe98e8a88736ce3889645ea' \
+          'da23740c0fd12014577d2a9365a5ea35ce83c786')
# optimization OK
diff --git a/source/lib/fontconfig/fontconfig-fix.patch 
b/source/lib/fontconfig/fontconfig-fix.patch
new file mode 100644
index 0000000..2cfa380
--- /dev/null
+++ b/source/lib/fontconfig/fontconfig-fix.patch
@@ -0,0 +1,156 @@
+--- src/fcfreetype.c
++++ src/fcfreetype.c
+@@ -1104,7 +1104,10 @@ FcFreeTypeQueryFace (const FT_Face  face,
+     char          psname[256];
+     const char            *tmp;
+
+-    FcChar8       *hashstr;
++    FcChar8       *hashstr = NULL;
++    char          *fontdata = NULL;
++    FT_Error      err;
++    FT_ULong      len = 0, alen;
+
+     pat = FcPatternCreate ();
+     if (!pat)
+@@ -1662,12 +1665,34 @@ FcFreeTypeQueryFace (const FT_Face  face,
+     if (!FcPatternAddBool (pat, FC_DECORATIVE, decorative))
+       goto bail1;
+
+-    hashstr = FcHashGetSHA256DigestFromFile (file);
++    err = FT_Load_Sfnt_Table (face, 0, 0, NULL, &len);
++    if (err == FT_Err_Ok)
++    {
++      alen = (len + 63) & ~63;
++      fontdata = malloc (alen);
++      if (!fontdata)
++          goto bail1;
++      err = FT_Load_Sfnt_Table (face, 0, 0, (FT_Byte *)fontdata, &len);
++      if (err != FT_Err_Ok)
++          goto bail1;
++      memset (&fontdata[len], 0, alen - len);
++      hashstr = FcHashGetSHA256DigestFromMemory (fontdata, len);
++    }
++    else if (err == FT_Err_Invalid_Face_Handle)
++    {
++      /* font may not support SFNT. falling back to
++       * read the font data from file directly
++       */
++      hashstr = FcHashGetSHA256DigestFromFile (file);
++    }
++    else
++    {
++      goto bail1;
++    }
+     if (!hashstr)
+       goto bail1;
+     if (!FcPatternAddString (pat, FC_HASH, hashstr))
+       goto bail1;
+-    free (hashstr);
+
+     /*
+      * Compute the unicode coverage for the font
+@@ -1756,6 +1781,10 @@ FcFreeTypeQueryFace (const FT_Face  face,
+ bail2:
+     FcCharSetDestroy (cs);
+ bail1:
++    if (hashstr)
++      free (hashstr);
++    if (fontdata)
++      free (fontdata);
+     FcPatternDestroy (pat);
+ bail0:
+     return NULL;
+diff --git a/src/fchash.c b/src/fchash.c
+index 827b20f..92585a6 100644
+--- src/fchash.c
++++ src/fchash.c
+@@ -220,7 +220,7 @@ FcHashGetSHA256DigestFromFile (const FcChar8 *filename)
+
+     ret = FcHashInitSHA256Digest ();
+     if (!ret)
+-      return NULL;
++      goto bail0;
+
+     while (!feof (fp))
+     {
+@@ -261,5 +261,60 @@ FcHashGetSHA256DigestFromFile (const FcChar8 *filename)
+
+ bail0:
+     fclose (fp);
++
+     return NULL;
+ }
++
++FcChar8 *
++FcHashGetSHA256DigestFromMemory (const char *fontdata,
++                               size_t      length)
++{
++    char ibuf[64];
++    FcChar32 *ret;
++    size_t i = 0;
++
++    ret = FcHashInitSHA256Digest ();
++    if (!ret)
++      return NULL;
++
++    while (i <= length)
++    {
++      if ((length - i) < 64)
++      {
++          long v;
++          size_t n;
++
++          /* add a padding */
++          n = length - i;
++          if (n > 0)
++              memcpy (ibuf, &fontdata[i], n);
++          memset (&ibuf[n], 0, 64 - n);
++          ibuf[n] = 0x80;
++          if ((64 - n) < 9)
++          {
++              /* process a block once */
++              FcHashComputeSHA256Digest (ret, ibuf);
++              memset (ibuf, 0, 64);
++          }
++          /* set input size at the end */
++          v = length * 8;
++          ibuf[63 - 0] =  v        & 0xff;
++          ibuf[63 - 1] = (v >>  8) & 0xff;
++          ibuf[63 - 2] = (v >> 16) & 0xff;
++          ibuf[63 - 3] = (v >> 24) & 0xff;
++          ibuf[63 - 4] = (v >> 32) & 0xff;
++          ibuf[63 - 5] = (v >> 40) & 0xff;
++          ibuf[63 - 6] = (v >> 48) & 0xff;
++          ibuf[63 - 7] = (v >> 56) & 0xff;
++          FcHashComputeSHA256Digest (ret, ibuf);
++          break;
++      }
++      else
++      {
++          FcHashComputeSHA256Digest (ret, &fontdata[i]);
++      }
++      i += 64;
++    }
++
++    return FcHashSHA256ToString (ret);
++}
+diff --git a/src/fcint.h b/src/fcint.h
+index c45075e..8919958 100644
+--- src/fcint.h
++++ src/fcint.h
+@@ -818,9 +818,14 @@ FcFontSetSerialize (FcSerialize *serialize, const 
FcFontSet * s);
+ FcPrivate FcChar8 *
+ FcHashGetSHA256Digest (const FcChar8 *input_strings,
+                      size_t         len);
++
+ FcPrivate FcChar8 *
+ FcHashGetSHA256DigestFromFile (const FcChar8 *filename);
+
++FcPrivate FcChar8 *
++FcHashGetSHA256DigestFromMemory (const char *fontdata,
++                               size_t      length);
++
+ /* fcinit.c */
+ FcPrivate FcConfig *
+ FcInitLoadOwnConfig (FcConfig *config);
+
diff --git a/source/lib/fontconfig/git.patch b/source/lib/fontconfig/git.patch
new file mode 100644
index 0000000..c0e5afa
--- /dev/null
+++ b/source/lib/fontconfig/git.patch
@@ -0,0 +1,60 @@
+--- src/fcmatch.c
++++ src/fcmatch.c
+@@ -227,9 +227,10 @@ typedef enum _FcMatcherPriorityDummy {
+ #undef FC_OBJECT
+
+ #undef PRI1
+-#define PRI1(n)                       \
+-    PRI_ ## n ## _STRONG,     \
+-    PRI_ ## n ## _WEAK
++#define PRI1(n)                                       \
++    PRI_ ## n,                                        \
++    PRI_ ## n ## _STRONG = PRI_ ## n,         \
++    PRI_ ## n ## _WEAK = PRI_ ## n
+
+ typedef enum _FcMatcherPriority {
+     PRI1(HASH),
+@@ -237,9 +238,8 @@ typedef enum _FcMatcherPriority {
+     PRI1(FOUNDRY),
+     PRI1(CHARSET),
+     PRI_FAMILY_STRONG,
+-    PRI_LANG_STRONG,
+     PRI_POSTSCRIPT_NAME_STRONG,
+-    PRI_LANG_WEAK,
++    PRI1(LANG),
+     PRI_FAMILY_WEAK,
+     PRI_POSTSCRIPT_NAME_WEAK,
+     PRI1(SPACING),
+@@ -910,8 +910,7 @@ FcFontSetSort (FcConfig        *config FC_UNUSED,
+        * If this node matches any language, go check
+        * which ones and satisfy those entries
+        */
+-      if (nodeps[f]->score[PRI_LANG_STRONG] < 2000 ||
+-          nodeps[f]->score[PRI_LANG_WEAK] < 2000)
++      if (nodeps[f]->score[PRI_LANG] < 2000)
+       {
+           for (i = 0; i < nPatternLang; i++)
+           {
+@@ -935,13 +934,6 @@ FcFontSetSort (FcConfig       *config FC_UNUSED,
+                       }
+                       patternLangSat[i] = FcTrue;
+                       satisfies = FcTrue;
+-                      /* adjust score to ensure it's not more than 10000.0
+-                       * which would means the lang didn't satisfy the 
requirements
+-                       */
+-                      if (nodeps[f]->score[PRI_LANG_STRONG] > 10000.0)
+-                          nodeps[f]->score[PRI_LANG_STRONG] = 10000.0;
+-                      if (nodeps[f]->score[PRI_LANG_WEAK] > 10000.0)
+-                          nodeps[f]->score[PRI_LANG_WEAK] = 10000.0;
+                       break;
+                   }
+               }
+@@ -949,8 +941,7 @@ FcFontSetSort (FcConfig        *config FC_UNUSED,
+       }
+       if (!satisfies)
+       {
+-          nodeps[f]->score[PRI_LANG_STRONG] = 10000.0;
+-          nodeps[f]->score[PRI_LANG_WEAK] = 10000.0;
++          nodeps[f]->score[PRI_LANG] = 10000.0;
+       }
+     }
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to