import fontconfig-2.13.94-2.el9

This commit is contained in:
CentOS Sources 2022-05-17 04:49:14 -04:00 committed by Stepan Oksanichenko
commit 7cd9752a48
10 changed files with 1433 additions and 0 deletions

1
.fontconfig.metadata Normal file
View File

@ -0,0 +1 @@
4d2d34e0894141a9ed6b5693caa06560d7b741e9 SOURCES/fontconfig-2.13.94.tar.xz

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
SOURCES/fontconfig-2.13.94.tar.xz

View File

@ -0,0 +1,44 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<test name="family" compare="eq">
<string>Kochi Mincho</string>
</test>
<edit name="embeddedbitmap" mode="assign">
<bool>false</bool>
</edit>
</match>
<match target="font">
<test name="family" compare="eq">
<string>Kochi Gothic</string>
</test>
<edit name="embeddedbitmap" mode="assign">
<bool>false</bool>
</edit>
</match>
<match target="font">
<test name="family" compare="eq">
<string>Sazanami Mincho</string>
</test>
<edit name="embeddedbitmap" mode="assign">
<bool>false</bool>
</edit>
</match>
<match target="font">
<test name="family" compare="eq">
<string>Sazanami Gothic</string>
</test>
<edit name="embeddedbitmap" mode="assign">
<bool>false</bool>
</edit>
</match>
<match target="font">
<test name="family" compare="eq">
<string>AR PL ShanHeiSun Uni</string>
</test>
<edit name="embeddedbitmap" mode="assign">
<bool>true</bool>
</edit>
</match>
</fontconfig>

4
SOURCES/fc-cache Executable file
View File

@ -0,0 +1,4 @@
#! /bin/sh
[ -x /usr/bin/fc-cache-32 ] && /usr/bin/fc-cache-32 "$@" || :
[ -x /usr/bin/fc-cache-64 ] && /usr/bin/fc-cache-64 "$@" || :

View File

@ -0,0 +1,33 @@
diff -pruN fontconfig-2.13.93.orig/test/run-test.sh fontconfig-2.13.93/test/run-test.sh
--- fontconfig-2.13.93.orig/test/run-test.sh 2020-11-28 10:56:42.000000000 +0900
+++ fontconfig-2.13.93/test/run-test.sh 2020-11-28 12:39:57.345644527 +0900
@@ -421,18 +421,18 @@ rm -rf "$MYCACHEBASEDIR" "$MYCONFIG" my-
fi # if [ "x$EXEEXT" = "x" ]
-if [ -x "$BUILDTESTDIR"/test-crbug1004254 ]; then
- dotest "MT-safe global config"
- prep
- curl -s -o "$FONTDIR"/noto.zip https://noto-website-2.storage.googleapis.com/pkgs/NotoSans-hinted.zip
- (cd "$FONTDIR"; unzip noto.zip)
- if [ -n "${SOURCE_DATE_EPOCH:-}" ] && [ ${#SOURCE_DATE_EPOCH} -gt 0 ]; then
- touch -m -t "$(date -d @"${SOURCE_DATE_EPOCH}" +%y%m%d%H%M.%S)" "$FONTDIR"
- fi
- "$BUILDTESTDIR"/test-crbug1004254
-else
+#if [ -x "$BUILDTESTDIR"/test-crbug1004254 ]; then
+# dotest "MT-safe global config"
+# prep
+# curl -s -o "$FONTDIR"/noto.zip https://noto-website-2.storage.googleapis.com/pkgs/NotoSans-hinted.zip
+# (cd "$FONTDIR"; unzip noto.zip)
+# if [ -n "${SOURCE_DATE_EPOCH:-}" ] && [ ${#SOURCE_DATE_EPOCH} -gt 0 ]; then
+# touch -m -t "$(date -d @"${SOURCE_DATE_EPOCH}" +%y%m%d%H%M.%S)" "$FONTDIR"
+# fi
+# "$BUILDTESTDIR"/test-crbug1004254
+#else
echo "No test-crbug1004254: skipped"
-fi
+#fi
if [ "x$EXEEXT" = "x" ]; then

View File

@ -0,0 +1,12 @@
diff -pruN fontconfig-2.13.92.orig/src/fcformat.c fontconfig-2.13.92/src/fcformat.c
--- fontconfig-2.13.92.orig/src/fcformat.c 2018-07-19 12:14:39.000000000 +0900
+++ fontconfig-2.13.92/src/fcformat.c 2020-01-20 13:05:33.626227767 +0900
@@ -78,7 +78,7 @@
#define FCCAT_FORMAT "\"%{file|basename|cescape}\" %{index} \"%{-file{%{=unparse|cescape}}}\""
#define FCMATCH_FORMAT "%{file:-<unknown filename>|basename}: \"%{family[0]:-<unknown family>}\" \"%{style[0]:-<unknown style>}\""
#define FCLIST_FORMAT "%{?file{%{file}: }}%{-file{%{=unparse}}}"
-#define PKGKIT_FORMAT "%{[]family{font(%{family|downcase|delete( )})\n}}%{[]lang{font(:lang=%{lang|downcase|translate(_,-)})\n}}"
+#define PKGKIT_FORMAT "%{[]family{font(%{family|downcase|delete( )})\n}}"
static void

View File

@ -0,0 +1,40 @@
From 2b897d4624f015c0f59a9f46925b758adfc79190 Mon Sep 17 00:00:00 2001
From: Akira TAGOH <akira@tagoh.org>
Date: Mon, 19 Jul 2021 21:03:20 +0900
Subject: [PATCH] Enable 11-lcdfilter-default.conf by default
Some applications needs this enabled by default on non-GNOME desktops.
reference: https://bugzilla.redhat.com/show_bug.cgi?id=1965684
---
conf.d/Makefile.am | 1 +
conf.d/meson.build | 1 +
2 files changed, 2 insertions(+)
diff --git a/conf.d/Makefile.am b/conf.d/Makefile.am
index 710318c1..43b6e2b9 100644
--- a/conf.d/Makefile.am
+++ b/conf.d/Makefile.am
@@ -32,6 +32,7 @@ DOC_FILES = $(DOC_SOURCES:.in=)
CONF_LINKS = \
10-hinting-$(PREFERRED_HINTING).conf \
10-scale-bitmap-fonts.conf \
+ 11-lcdfilter-default.conf \
20-unhint-small-vera.conf \
30-metric-aliases.conf \
40-nonlatin.conf \
diff --git a/conf.d/meson.build b/conf.d/meson.build
index 2cb144ee..172e2af2 100644
--- a/conf.d/meson.build
+++ b/conf.d/meson.build
@@ -42,6 +42,7 @@ preferred_hinting = 'slight'
conf_links = [
'10-hinting-@0@.conf'.format(preferred_hinting),
'10-scale-bitmap-fonts.conf',
+ '11-lcdfilter-default.conf',
'20-unhint-small-vera.conf',
'30-metric-aliases.conf',
'40-nonlatin.conf',
--
2.32.0

View File

@ -0,0 +1,188 @@
From 4d43f84188847a6a77f7259f986fb178c52c1ea7 Mon Sep 17 00:00:00 2001
From: Akira TAGOH <akira@tagoh.org>
Date: Thu, 8 Jul 2021 14:21:50 +0900
Subject: [PATCH 1/2] Do not set different score to non-string values
Non-string values in a cache is supposed to choose one from them.
Due to the change of da1c9f7a, there was a regression on scoring for
matching functions. So reverting the behavior for evaluating non-string
values to the previous one.
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/286
---
src/fcmatch.c | 2 +-
test/Makefile.am | 1 +
test/run-test-conf.sh | 1 +
test/test-conf.c | 71 ++++++++++++++++++++++++++--------------
test/test-issue-286.json | 35 ++++++++++++++++++++
5 files changed, 85 insertions(+), 25 deletions(-)
create mode 100644 test/test-issue-286.json
diff --git a/src/fcmatch.c b/src/fcmatch.c
index c88e3aa..fd43cbd 100644
--- a/src/fcmatch.c
+++ b/src/fcmatch.c
@@ -433,7 +433,7 @@ FcCompareValueList (FcObject object,
*result = FcResultTypeMismatch;
return FcFalse;
}
- v = v * 1000 + j * 100 + k;
+ v = v * 1000 + j * 100 + k * (v2->value.type == FcTypeString ? 1 : 0);
if (v < best)
{
if (bestValue)
diff --git a/test/Makefile.am b/test/Makefile.am
index aea8724..d07654b 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -47,6 +47,7 @@ TESTDATA = \
test-45-generic.json \
test-60-generic.json \
test-90-synthetic.json \
+ test-issue-286.json \
test-style-match.json \
$(NULL)
diff --git a/test/run-test-conf.sh b/test/run-test-conf.sh
index 0c2bd52..bbb56f4 100644
--- a/test/run-test-conf.sh
+++ b/test/run-test-conf.sh
@@ -49,6 +49,7 @@ for i in \
$RUNNER $TESTDIR/../conf.d/$i $TESTDIR/$test_json
done
for i in \
+ test-issue-286.json \
test-style-match.json \
; do
echo $RUNNER $TESTDIR/$i ...
diff --git a/test/test-conf.c b/test/test-conf.c
index e4e9da4..1a52c6e 100644
--- a/test/test-conf.c
+++ b/test/test-conf.c
@@ -207,35 +207,58 @@ build_pattern (json_object *obj)
}
}
} else if (type == json_type_double || type == json_type_int) {
+ const FcObjectType *fc_o = FcNameGetObjectType (iter.key);
double values[4];
- if (n != 2 && n != 4) {
- fprintf (stderr, "E: array starting with number not range or matrix\n");
+
+ if (fc_o && fc_o->type == FcTypeDouble) {
+ for (i = 0; i < n; i++)
+ {
+ o = json_object_array_get_idx (iter.val, i);
+ type = json_object_get_type (o);
+ if (type == json_type_double) {
+ v.type = FcTypeDouble;
+ v.u.d = json_object_get_double (o);
+ } else if (type == json_type_int) {
+ v.type = FcTypeInteger;
+ v.u.i = json_object_get_int (o);
+ } else {
+ fprintf (stderr, "E: unable to convert to double\n");
+ continue;
+ }
+ FcPatternAdd (pat, iter.key, v, FcTrue);
+ v.type = FcTypeVoid;
+ }
continue;
- }
- for (i = 0; i < n; i++) {
- o = json_object_array_get_idx (iter.val, i);
- type = json_object_get_type (o);
- if (type != json_type_double && type != json_type_int) {
- fprintf (stderr, "E: numeric array entry not a number\n");
+ } else {
+ if (n != 2 && n != 4) {
+ fprintf (stderr, "E: array starting with number not range or matrix\n");
continue;
}
- values[i] = json_object_get_double (o);
- }
- if (n == 2) {
- v.type = FcTypeRange;
- v.u.r = FcRangeCreateDouble (values[0], values[1]);
- if (!v.u.r) {
- fprintf (stderr, "E: failed to create range\n");
- continue;
+ for (i = 0; i < n; i++) {
+ o = json_object_array_get_idx (iter.val, i);
+ type = json_object_get_type (o);
+ if (type != json_type_double && type != json_type_int) {
+ fprintf (stderr, "E: numeric array entry not a number\n");
+ continue;
+ }
+ values[i] = json_object_get_double (o);
+ }
+ if (n == 2) {
+ v.type = FcTypeRange;
+ v.u.r = FcRangeCreateDouble (values[0], values[1]);
+ if (!v.u.r) {
+ fprintf (stderr, "E: failed to create range\n");
+ continue;
+ }
+ destroy_v = FcTrue;
+ } else {
+ v.type = FcTypeMatrix;
+ v.u.m = &matrix;
+ matrix.xx = values[0];
+ matrix.xy = values[1];
+ matrix.yx = values[2];
+ matrix.yy = values[3];
}
- destroy_v = FcTrue;
- } else {
- v.type = FcTypeMatrix;
- v.u.m = &matrix;
- matrix.xx = values[0];
- matrix.xy = values[1];
- matrix.yx = values[2];
- matrix.yy = values[3];
}
} else {
fprintf (stderr, "E: array format not recognized\n");
diff --git a/test/test-issue-286.json b/test/test-issue-286.json
new file mode 100644
index 0000000..a3199fa
--- /dev/null
+++ b/test/test-issue-286.json
@@ -0,0 +1,35 @@
+{
+ "fonts": [
+ {
+ "family": "Foo",
+ "style": "Italic",
+ "pixelsize": [15, 16, 17, 18],
+ "file": "/path/to/Foo-Italic.ttf",
+ "fontversion": 133365
+ },
+ {
+ "family": "Foo",
+ "style": "Regular",
+ "pixelsize": [11, 12, 13, 14, 15, 16, 17, 18, 22],
+ "file": "/path/to/Foo-Regular.ttf",
+ "fontversion": 133365
+ }
+ ],
+ "tests": [
+ {
+ "method": "match",
+ "query": {
+ "family": "Foo",
+ "style": "Regular",
+ "pixelsize": 16
+ },
+ "result": {
+ "family": "Foo",
+ "style": "Regular",
+ "pixelsize": 16,
+ "file": "/path/to/Foo-Regular.ttf",
+ "fontversion": 133365
+ }
+ }
+ ]
+}
--
2.31.1

View File

@ -0,0 +1,12 @@
diff -pruN fontconfig-2.12.91.orig/fc-cache/fc-cache.c fontconfig-2.12.91/fc-cache/fc-cache.c
--- fontconfig-2.12.91.orig/fc-cache/fc-cache.c 2017-11-20 21:02:20.000000000 +0900
+++ fontconfig-2.12.91/fc-cache/fc-cache.c 2017-12-14 16:59:19.002003145 +0900
@@ -413,7 +413,7 @@ main (int argc, char **argv)
*/
/* the resolution of mtime on FAT is 2 seconds */
if (changed)
- sleep (2);
+ sleep (1);
if (verbose)
printf ("%s: %s\n", argv[0], ret ? _("failed") : _("succeeded"));
return ret;

1098
SPECS/fontconfig.spec Normal file

File diff suppressed because it is too large Load Diff