Accepting request 176292 from home:sumski:branches:M17N

Update to version 2.10.93

OBS-URL: https://build.opensuse.org/request/show/176292
OBS-URL: https://build.opensuse.org/package/show/M17N/fontconfig?expand=0&rev=113
This commit is contained in:
Marguerite Su 2013-05-22 15:05:01 +00:00 committed by Git OBS Bridge
parent 1ce3dffbe2
commit 307adc6f09
8 changed files with 27 additions and 213 deletions

View File

@ -1,42 +0,0 @@
Index: fontconfig-2.10.92/conf.d/Makefile.am
===================================================================
--- fontconfig-2.10.92.orig/conf.d/Makefile.am
+++ fontconfig-2.10.92/conf.d/Makefile.am
@@ -78,6 +78,9 @@ template_DATA = \
80-delicious.conf \
90-synthetic.conf
+README: $(srcdir)/README.in
+ sed "s|\@TEMPLATEDIR\@|$(templatedir)|" <$(srcdir)/README.in >README
+
install-data-hook:
mkdir -p $(DESTDIR)$(configdir)
@(echo cd $(DESTDIR)$(configdir); \
Index: fontconfig-2.10.92/conf.d/README.in
===================================================================
--- /dev/null
+++ fontconfig-2.10.92/conf.d/README.in
@@ -0,0 +1,23 @@
+conf.d/README
+
+Each file in this directory is a fontconfig configuration file. Fontconfig
+scans this directory, loading all files of the form [0-9][0-9]*.conf.
+These files are normally installed in @TEMPLATEDIR@
+and then symlinked here, allowing them to be easily installed and then
+enabled/disabled by adjusting the symlinks.
+
+The files are loaded in numeric order, the structure of the configuration
+has led to the following conventions in usage:
+
+ Files begining with: Contain:
+
+ 00 through 09 Font directories
+ 10 through 19 system rendering defaults (AA, etc)
+ 20 through 29 font rendering options
+ 30 through 39 family substitution
+ 40 through 49 generic identification, map family->generic
+ 50 through 59 alternate config file loading
+ 60 through 69 generic aliases, map generic->family
+ 70 through 79 select font (adjust which fonts are available)
+ 80 through 89 match target="scan" (modify scanned patterns)
+ 90 through 99 font synthesis

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1162059927120f2321f12917189b524e6b2f09e11ac643278d0bb82634035b22
size 1525585

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ea901f278848829ed9937d76fb0ce63ad362d7d5b9e75aa6a6b78bfef42e529c
size 1526089

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:39b265d5011faa52a2dd5751c993e6743db5fa58218e04c2bb1211fa7f2f4908
size 95825

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:090775c4a505c4fd31689f862647a380073b4edb35efd77359633fa40f224718
size 96483

View File

@ -1,158 +0,0 @@
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index 8a037c0..5e8990d 100644
--- a/src/fcfreetype.c
+++ b/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
--- a/src/fchash.c
+++ b/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
--- a/src/fcint.h
+++ b/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);

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Tue May 21 17:07:35 UTC 2013 - hrvoje.senjan@gmail.com
- Update to version 2.10.93
+ matching native fonts with even :lang=en (fdo#62980)
+ Ensure closing fp on error
+ Obtain fonts data via FT_Face instead of opening a file directly
+ Revert the previous change and rework to not export freetype
API outside fcfreetype.c
+ documented FC_HASH and FC_POSTSCRIPT_NAME
+ make check fails: .. contents:: :depth: 2 (fdo#63329)
+ Use the glob matching for filename
+ conf.d/README outdated (fdo#63452
+ Fix missing OSAtomicCompareAndSwapPtrBarrier() on Mac OS X 10.4
+ FcFreeTypeQueryFace fails on postscripts fonts loaded
from memory (fdo#63922)
+ build-chain, replace INCLUDES directive by AM_CPPFLAGS
- dropped conf.d-readme-templatedir.patch (upstreamed)
- dropped fontconfig-fix-webfont.patch (upstreamed)
-------------------------------------------------------------------
Sun May 12 12:27:43 UTC 2013 - dimstar@opensuse.org

View File

@ -48,7 +48,7 @@ Url: http://fontconfig.org/
Obsoletes: fontconfig-64bit
%endif
Requires: bash
Version: 2.10.92
Version: 2.10.93
Release: 0
Summary: Library for Font Configuration
License: MIT
@ -74,10 +74,6 @@ Source58: 58-suse-post-user.conf
Patch0: make-check.patch
# suse specific
Patch1: usr-share-doc-packages.patch
# to be upstreamed
Patch2: conf.d-readme-templatedir.patch
# PATCH-FIX-UPSTREAM fontconfig-fix-webfont.patch bnc#819467 rh#946859 dimstar@opensuse.org -- Fix webfont issue
Patch3: fontconfig-fix-webfont.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: ipa-fonts-config = 003.02
Obsoletes: ipa-fonts-config <= 003.02
@ -122,8 +118,6 @@ accepts font patterns and returns the nearest matching font.
%endif
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
# ----- build with automake 1.13