Compare commits

..

43 commits

Author SHA1 Message Date
Fedora Release Engineering
90ff975dce Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-23 20:41:05 +00:00
Akira TAGOH
b06b4f8a91 bump a release 2025-06-30 16:51:15 +09:00
Akira TAGOH
8bca22ae68 Backport a patch to fix a crash with Graphite fonts
Drop 70-*bitmaps*.conf from /etc/fonts/conf.d so far.
  Resolves: rhbz#2375426
2025-06-30 16:50:15 +09:00
Akira TAGOH
9a1e8029b0 New upstream release.
Resolves: rhbz#2375126
2025-06-27 14:48:43 +09:00
Akira TAGOH
518fc318a2 Adjust patches and cleanup 2025-04-11 17:14:41 +09:00
Akira TAGOH
3a435a53cb New upstream release. 2025-04-11 16:57:12 +09:00
Akira TAGOH
97f5c4867a New upstream release. 2025-03-13 20:46:22 +09:00
Akira TAGOH
702de2a7ad Bump the release 2025-01-27 11:46:26 +09:00
Akira TAGOH
7ee5fe6990 Fix endian detection.
Resolves: rhbz#2341757
2025-01-27 11:20:34 +09:00
Akira TAGOH
64359ad1d0 Disable meson test on s390x temporarily 2025-01-23 23:32:46 +09:00
Akira TAGOH
d1acb38e3b Add gcc to BR 2025-01-23 22:44:43 +09:00
Akira TAGOH
54b1870164 Patch meson.build instead of creating a cache dir 2025-01-20 16:43:04 +09:00
Akira TAGOH
cab4ae8a7a Add a reference to bz 2025-01-18 01:40:36 +09:00
Akira TAGOH
4c49ef27c3 clean up patches 2025-01-18 01:39:40 +09:00
Akira TAGOH
39a7075dc3 New upstream release.
Use meson instead of autotools to build.
2025-01-18 01:37:41 +09:00
Fedora Release Engineering
e2bb04c6db Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-16 18:36:18 +00:00
Akira TAGOH
c671260692 Fix a memory leak and potentially uninitialized values. 2024-08-01 12:45:32 +09:00
Akira TAGOH
c400e27282 ci: Add fmf plan file 2024-07-19 20:09:56 +09:00
Akira TAGOH
d3f982b32d ci: Use tmt based test cases 2024-07-18 19:37:56 +09:00
Fedora Release Engineering
067f5c6f8e Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-17 23:26:13 +00:00
Akira TAGOH
354394f0f4 Own /usr/lib/fontconfig
Resolves: rhbz#2284076
2024-06-07 23:03:12 +09:00
Michael Kuhn
be5b48f736 Fix emoji fonts being disabled when bitmap fonts were disabled 2024-04-30 01:22:24 +02:00
Akira TAGOH
e200ccfc72 Delete .uuid with fc-cache -f.
Resolves: rhbz#1761885
2024-02-10 02:28:59 +09:00
Fedora Release Engineering
50326b4808 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-24 11:51:39 +00:00
Fedora Release Engineering
bfd9218620 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-19 19:36:21 +00:00
Akira TAGOH
d72678cc75 New upstream release.
Resolves: rhbz#2255623
2023-12-22 23:12:42 +09:00
Akira TAGOH
1b1dff0137 Bump a release 2023-08-17 17:43:37 +09:00
Akira TAGOH
353020918c Update 65-nonlatin.conf to 69-nonlatin.conf
This basically provides substitutes for certain languages and is helpful
  to determine default behavior though, we have per-package config for similar purpose.
  Since 65 is mostly used for default fonts and this config prevents some behavior for
  packages named something coming later than "nonlatin" in the alphabetical order.
  So moving this to the safer priority.
  This would fixes an issue, particularly Lohit Marathi vs Lohit Devanagari after
  updating their priorities from 65 to 66.
2023-08-17 17:25:57 +09:00
Fedora Release Engineering
7450f4c8e9 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-19 20:01:44 +00:00
Akira TAGOH
b1ee7ffdbd Drop 10-sub-pixel-rgb-for-kde.conf
Resolves: rhbz#2212512
2023-06-16 18:14:18 +09:00
Akira TAGOH
a71d8d0d33 Migrated license tag to SPDX. 2023-04-04 14:54:59 +09:00
Akira TAGOH
03bbd6991d New upstream release. 2023-01-27 18:01:51 +09:00
Fedora Release Engineering
3d26dfea36 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 03:43:11 +00:00
Akira TAGOH
25e368d9d2 Enable RGB stripes layout for sub-pixel rendering on KDE only.
Resolves: rhbz#2137825
2022-11-26 15:57:22 +09:00
Akira TAGOH
1b2e3f5380 Enable RGB stripes layout for sub-pixel rendering on KDE only.
Resolves: rhbz#2137825
2022-11-26 15:51:35 +09:00
Akira TAGOH
dbbbc58182 Enable RGB stripes layout for sub-pixel rendering on KDE only.
Resolves: rhbz#2137825
2022-11-26 15:51:20 +09:00
Akira TAGOH
8656c32f21 New upstream release. 2022-10-21 17:13:31 +09:00
Akira TAGOH
fe5f5a11d5 Remap font paths to other place properly. 2022-09-29 00:30:42 +09:00
Fedora Release Engineering
177d7fafb7 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 03:27:00 +00:00
Akira TAGOH
395eea0c20 New upstream release. 2022-03-31 20:36:41 +09:00
Akira TAGOH
189f0d39cd New upstream release.
Fix missing a file in the archive.
  Resolves: rhbz#2050478
2022-02-04 18:08:16 +09:00
Akira TAGOH
86ee1af10c New upstream release.
Update deps to font(notosans)
  https://fedoraproject.org/wiki/Changes/DefaultToNotoFonts
2022-02-01 15:20:42 +09:00
Fedora Release Engineering
12eb8925cc - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 03:15:36 +00:00
16 changed files with 365 additions and 391 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

10
.gitignore vendored
View file

@ -34,3 +34,13 @@ fontconfig-2.8.0.tar.gz
/fontconfig-2.13.92.tar.xz
/fontconfig-2.13.93.tar.xz
/fontconfig-2.13.94.tar.xz
/fontconfig-2.13.95.tar.xz
/fontconfig-2.13.96.tar.xz
/fontconfig-2.14.0.tar.xz
/fontconfig-2.14.1.tar.xz
/fontconfig-2.14.2.tar.xz
/fontconfig-2.15.0.tar.xz
/fontconfig-2.16.0.tar.xz
/fontconfig-2.16.1.tar.xz
/fontconfig-2.16.2.tar.xz
/fontconfig-2.17.0.tar.xz

View file

@ -1,44 +0,0 @@
From 57032f489b2cbe98c8e7927f4c18738869831f41 Mon Sep 17 00:00:00 2001
From: Akira TAGOH <akira@tagoh.org>
Date: Wed, 25 Aug 2021 15:52:53 +0900
Subject: [PATCH] Fix a memory leak when trying to open a non-existing file
https://bugzilla.redhat.com/show_bug.cgi?id=1914716
---
src/fccache.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/fccache.c b/src/fccache.c
index ae3b9e3..d8ffe09 100644
--- a/src/fccache.c
+++ b/src/fccache.c
@@ -1111,7 +1111,7 @@ FcCache *
FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat)
{
int fd;
- FcCache *cache;
+ FcCache *cache = NULL;
struct stat my_file_stat;
FcConfig *config;
@@ -1121,11 +1121,13 @@ FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat)
if (!config)
return NULL;
fd = FcDirCacheOpenFile (cache_file, file_stat);
- if (fd < 0)
- return NULL;
- cache = FcDirCacheMapFd (config, fd, file_stat, NULL);
+ if (fd >= 0)
+ {
+ cache = FcDirCacheMapFd (config, fd, file_stat, NULL);
+ close (fd);
+ }
FcConfigDestroy (config);
- close (fd);
+
return cache;
}
--
2.35.1

View file

@ -1,48 +0,0 @@
From 2d17232a45c55cdb8d082a3bcf13d423928fcd5e Mon Sep 17 00:00:00 2001
From: Akira TAGOH <akira@tagoh.org>
Date: Fri, 8 Oct 2021 18:29:48 +0900
Subject: [PATCH] Fix score estimation for postscriptname
Before this fix:
$ fc-match :postscriptname=LiberationSans
LiberationSansNarrow.ttf: "Liberation Sans Narrow" "Regular"
After this fix:
$ fc-match :postscriptname=LiberationSans
LiberationSans-Regular.ttf: "Liberation Sans" "Regular"
See https://bugzilla.redhat.com/show_bug.cgi?id=1946871
---
src/fcmatch.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/fcmatch.c b/src/fcmatch.c
index 80d5687..cf0876c 100644
--- a/src/fcmatch.c
+++ b/src/fcmatch.c
@@ -86,7 +86,7 @@ FcComparePostScript (const FcValue *v1, const FcValue *v2, FcValue *bestValue)
const FcChar8 *v1_string = FcValueString (v1);
const FcChar8 *v2_string = FcValueString (v2);
int n;
- size_t len;
+ size_t len1, len2, mlen;
*bestValue = FcValueCanonicalize (v2);
@@ -95,9 +95,11 @@ FcComparePostScript (const FcValue *v1, const FcValue *v2, FcValue *bestValue)
return 1.0;
n = FcStrMatchIgnoreCaseAndDelims (v1_string, v2_string, (const FcChar8 *)" -");
- len = strlen ((const char *)v1_string);
+ len1 = strlen ((const char *)v1_string);
+ len2 = strlen ((const char *)v2_string);
+ mlen = FC_MAX (len1, len2);
- return (double)(len - n) / (double)len;
+ return (double)(mlen - n) / (double)mlen;
}
static double
--
2.35.1

View file

@ -1,7 +1,87 @@
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-
diff -pruN fontconfig-2.17.0.orig/test/meson.build fontconfig-2.17.0/test/meson.build
--- fontconfig-2.17.0.orig/test/meson.build 2025-06-27 12:12:04.000000000 +0900
+++ fontconfig-2.17.0/test/meson.build 2025-06-27 14:41:08.843726446 +0900
@@ -1,16 +1,16 @@
-fetch_test_fonts = custom_target(
- 'fetch_test_fonts',
- output: 'testfonts',
- command: [
- python3,
- join_paths(meson.project_source_root(), 'build-aux', 'fetch-testfonts.py'),
- '--target-dir',
- '@BUILD_ROOT@/testfonts',
- '--try-symlink',
- ],
- build_by_default: false,
- build_always_stale: true,
-)
+#fetch_test_fonts = custom_target(
+# 'fetch_test_fonts',
+# output: 'testfonts',
+# command: [
+# python3,
+# join_paths(meson.project_source_root(), 'build-aux', 'fetch-testfonts.py'),
+# '--target-dir',
+# '@BUILD_ROOT@/testfonts',
+# '--try-symlink',
+# ],
+# build_by_default: false,
+# build_always_stale: true,
+#)
tests = [
['test-bz89617.c', {'c_args': ['-DSRCDIR="@0@"'.format(meson.current_source_dir())]}],
@@ -33,7 +33,7 @@ if host_machine.system() != 'windows'
]
tests_not_parallel += [
# FIXME: this needs NotoSans-hinted.zip font downloaded and unpacked into test build directory! see run-test.sh
- ['test-crbug1004254.c', {'dependencies': dependency('threads')}], # for pthread
+ # ['test-crbug1004254.c', {'dependencies': dependency('threads')}], # for pthread
['test-mt-fccfg.c', {'include_directories': include_directories('../src'), 'dependencies': dependency('threads')}],
]
@@ -74,10 +74,10 @@ foreach test_data : tests + tests_not_pa
endforeach
-if get_option('fontations').enabled()
- rust = import('rust')
- rust.test('fc_fontations_rust_tests', fc_fontations, link_with: [libfontconfig_internal], depends: fetch_test_fonts, env: ['builddir=@0@'.format(meson.project_build_root())],)
-endif
+#if get_option('fontations').enabled()
+# rust = import('rust')
+# rust.test('fc_fontations_rust_tests', fc_fontations, link_with: [libfontconfig_internal], depends: fetch_test_fonts, env: ['builddir=@0@'.format(meson.project_build_root())],)
+#endif
fs = import('fs')
@@ -92,14 +92,14 @@ if host_machine.system() != 'windows'
test('run_test_sh', find_program('run-test.sh'), timeout: 600, env: ['srcdir=@0@'.format(meson.current_source_dir()), 'builddir=@0@'.format(meson.current_build_dir()), 'EXEEXT=@0@'.format(conf.get('EXEEXT')), 'VERBOSE=1'])
- if pytest.found()
- test('pytest', pytest, args: ['--tap'],
- workdir: meson.current_source_dir(),
- env: ['builddir=@0@'.format(meson.project_build_root())],
- protocol: 'tap',
- timeout: 600,
- depends: fetch_test_fonts)
- endif
+# if pytest.found()
+# test('pytest', pytest, args: ['--tap'],
+# workdir: meson.current_source_dir(),
+# env: ['builddir=@0@'.format(meson.project_build_root())],
+# protocol: 'tap',
+# timeout: 600,
+# depends: fetch_test_fonts)
+# endif
endif
if jsonc_dep.found()
diff -pruN fontconfig-2.17.0.orig/test/run-test.sh fontconfig-2.17.0/test/run-test.sh
--- fontconfig-2.17.0.orig/test/run-test.sh 2025-06-27 12:12:04.000000000 +0900
+++ fontconfig-2.17.0/test/run-test.sh 2025-06-27 14:39:19.098581228 +0900
@@ -521,18 +521,18 @@ rm -rf "$MYCACHEBASEDIR" "$MYCONFIG" "$B
fi # if [ "x$EXEEXT" = "x" ]
@ -11,7 +91,7 @@ diff -pruN fontconfig-2.13.93.orig/test/run-test.sh fontconfig-2.13.93/test/run-
- 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"
- touch -m -t "$(fdate ${SOURCE_DATE_EPOCH})" "$FONTDIR"
- fi
- "$BUILDTESTDIR"/test-crbug1004254
-else
@ -21,7 +101,7 @@ diff -pruN fontconfig-2.13.93.orig/test/run-test.sh fontconfig-2.13.93/test/run-
+# 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"
+# touch -m -t "$(fdate ${SOURCE_DATE_EPOCH})" "$FONTDIR"
+# fi
+# "$BUILDTESTDIR"/test-crbug1004254
+#else

View file

@ -1,12 +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}}"
diff -pruN fontconfig-2.16.1.orig/src/fcformat.c fontconfig-2.16.1/src/fcformat.c
--- fontconfig-2.16.1.orig/src/fcformat.c 2025-03-13 20:16:47.000000000 +0900
+++ fontconfig-2.16.1/src/fcformat.c 2025-03-13 20:42:03.633324643 +0900
@@ -77,7 +77,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
message (const char *fmt, ...)

View file

@ -0,0 +1,28 @@
From b9bec06d73340f1b5727302d13ac3df307b7febc Mon Sep 17 00:00:00 2001
From: Akira TAGOH <akira@tagoh.org>
Date: Mon, 30 Jun 2025 09:05:18 +0900
Subject: [PATCH] Fix a heap buffer overflow
https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/481
Changelog: fixed
---
src/fcfreetype.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index 7a4d9811..0a87d27a 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -2661,7 +2661,7 @@ FcFontCapabilities (FT_Face face)
goto bail;
maxsize = (((FT_ULong)gpos_count + (FT_ULong)gsub_count) * OTLAYOUT_LEN +
- (issilgraphitefont ? strlen(fcSilfCapability) : 0));
+ (issilgraphitefont ? strlen(fcSilfCapability) + 1: 0));
complex_ = malloc (sizeof (FcChar8) * maxsize);
if (!complex_)
goto bail;
--
2.50.0

View file

@ -1,40 +0,0 @@
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,42 @@
diff -pruN fontconfig-2.16.0.orig/conf.d/Makefile.am fontconfig-2.16.0/conf.d/Makefile.am
--- fontconfig-2.16.0.orig/conf.d/Makefile.am 2025-01-18 00:15:05.000000000 +0900
+++ fontconfig-2.16.0/conf.d/Makefile.am 2025-01-18 00:38:32.245398277 +0900
@@ -47,7 +47,7 @@ CONF_LINKS = \
60-generic.conf \
60-latin.conf \
65-fonts-persian.conf \
- 65-nonlatin.conf \
+ 69-nonlatin.conf \
69-unifont.conf \
80-delicious.conf \
90-synthetic.conf
@@ -95,7 +95,7 @@ template_DATA = \
60-latin.conf \
65-fonts-persian.conf \
65-khmer.conf \
- 65-nonlatin.conf \
+ 69-nonlatin.conf \
69-unifont.conf \
70-no-bitmaps.conf \
70-no-bitmaps-and-emoji.conf \
diff -pruN fontconfig-2.16.0.orig/conf.d/meson.build fontconfig-2.16.0/conf.d/meson.build
--- fontconfig-2.16.0.orig/conf.d/meson.build 2025-01-18 00:15:05.000000000 +0900
+++ fontconfig-2.16.0/conf.d/meson.build 2025-01-18 00:38:43.243595743 +0900
@@ -33,7 +33,7 @@ conf_files = [
'60-latin.conf',
'65-fonts-persian.conf',
'65-khmer.conf',
- '65-nonlatin.conf',
+ '69-nonlatin.conf',
'69-unifont.conf',
'70-no-bitmaps.conf',
'70-no-bitmaps-and-emoji.conf',
@@ -64,7 +64,7 @@ conf_links = [
'60-generic.conf',
'60-latin.conf',
'65-fonts-persian.conf',
- '65-nonlatin.conf',
+ '69-nonlatin.conf',
'69-unifont.conf',
'80-delicious.conf',
'90-synthetic.conf',

View file

@ -1,188 +0,0 @@
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

@ -4,13 +4,14 @@
Summary: Font configuration and customization library
Name: fontconfig
Version: 2.13.94
Release: 5%{?dist}
Version: 2.17.0
Release: 3%{?dist}
# src/ftglue.[ch] is in Public Domain
# src/fccache.c contains Public Domain code
## https://gitlab.com/fedora/legal/fedora-license-data/-/issues/177
# fc-case/CaseFolding.txt is in the UCD
# otherwise MIT
License: MIT and Public Domain and UCD
License: HPND AND LicenseRef-Fedora-Public-Domain AND Unicode-DFS-2016
Source: http://fontconfig.org/release/%{name}-%{version}.tar.xz
URL: http://fontconfig.org
Source1: 25-no-bitmap-fedora.conf
@ -20,18 +21,16 @@ Source2: fc-cache
Patch0: %{name}-sleep-less.patch
Patch4: %{name}-drop-lang-from-pkgkit-format.patch
Patch5: %{name}-disable-network-required-test.patch
Patch6: %{name}-score-fix.patch
Patch7: %{name}-lcdfilter.patch
Patch8: %{name}-1914716.patch
Patch9: %{name}-1946871.patch
Patch6: %{name}-lower-nonlatin-conf.patch
Patch7: %{name}-fix-crash.patch
BuildRequires: libxml2-devel
BuildRequires: freetype-devel >= %{freetype_version}
BuildRequires: fontpackages-devel
BuildRequires: autoconf automake libtool gettext
BuildRequires: gettext
BuildRequires: gperf
BuildRequires: docbook-utils docbook-utils-pdf
BuildRequires: make
BuildRequires: meson ninja-build gcc
Requires: fonts-filesystem freetype
# Register DTD system-wide to make validation work by default
@ -41,7 +40,7 @@ Requires(postun): xml-common
PreReq: freetype >= 2.9.1-6
Requires(post): grep coreutils
Requires: font(:lang=en)
Suggests: font(dejavusans)
Suggests: font(notosans)
%description
Fontconfig is designed to locate fonts within the
@ -73,37 +72,50 @@ which is useful for developing applications that uses fontconfig.
%prep
%autosetup -p1
# To reduce a maintenance cost of fontconfig-lower-nonlatin-conf.patch
mv conf.d/65-nonlatin.conf conf.d/69-nonlatin.conf
%build
# We don't want to rebuild the docs, but we want to install the included ones.
export HASDOCBOOK=no
for i in doc/*.fncs; do
touch -r $i ${i//.fncs/.sgml}
done
autoreconf
%configure --with-add-fonts=/usr/share/X11/fonts/Type1,/usr/share/X11/fonts/TTF,/usr/local/share/fonts \
--enable-libxml2 \
--disable-static --with-cache-dir=/usr/lib/fontconfig/cache
make %{?_smp_mflags}
%meson -Ddoc=disabled -Dcache-build=disabled -Dxml-backend=libxml2 \
-Dadditional-fonts-dirs=/usr/share/X11/fonts/Type1,/usr/share/X11/fonts/TTF,/usr/local/share/fonts \
-Dcache-dir=/usr/lib/fontconfig/cache \
--default-library=shared
%meson_build
%install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
%meson_install
install -p -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d
ln -s %{_fontconfig_templatedir}/25-unhint-nonlatin.conf $RPM_BUILD_ROOT%{_fontconfig_confdir}/
# move installed doc files back to build directory to package them
# in the right place
mv $RPM_BUILD_ROOT%{_docdir}/fontconfig/* .
rmdir $RPM_BUILD_ROOT%{_docdir}/fontconfig/
# Use implied value to allow the use of conditional conf
rm $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d/10-sub-pixel-*.conf
# Do not enable bitmap-related conf
rm $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d/70-*bitmaps*.conf
# Install docs manually
install -d $RPM_BUILD_ROOT%{_mandir}/man1
install -d $RPM_BUILD_ROOT%{_mandir}/man3
install -d $RPM_BUILD_ROOT%{_mandir}/man5
for f in doc/*.1; do
install -p -m 0644 $f $RPM_BUILD_ROOT%{_mandir}/man1
done
for f in doc/*.3; do
install -p -m 0644 $f $RPM_BUILD_ROOT%{_mandir}/man3
done
for f in doc/*.5; do
install -p -m 0644 $f $RPM_BUILD_ROOT%{_mandir}/man5
done
for f in doc/*.txt doc/*.pdf doc/*.html; do
install -p -m 0644 $f .
done
# adjust the timestamp to avoid conflicts for multilib
touch -r doc/fontconfig-user.sgml fontconfig-user.txt
touch -r doc/fontconfig-user.sgml fontconfig-user.html
touch -r doc/fontconfig-devel.sgml fontconfig-devel.txt
touch -r doc/fontconfig-devel.sgml fontconfig-devel.html
# rename fc-cache binary
mv $RPM_BUILD_ROOT%{_bindir}/fc-cache $RPM_BUILD_ROOT%{_bindir}/fc-cache-%{__isa_bits}
@ -118,7 +130,7 @@ install -p -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/fc-cache
cat %{name}-conf.lang >> %{name}.lang
%check
VERBOSE=1 make check
%meson_test
%post
umask 0022
@ -155,7 +167,7 @@ if [ $1 == 0 ] && [ -e %{_sysconfdir}/xml/catalog ]; then
fi
%files -f %{name}.lang
%doc README AUTHORS
%doc README.md AUTHORS
%doc fontconfig-user.txt fontconfig-user.html
%doc %{_fontconfig_confdir}/README
%license COPYING
@ -175,6 +187,7 @@ fi
# If you want to do so, you should use local.conf instead.
%config %{_fontconfig_masterdir}/fonts.conf
%config(noreplace) %{_fontconfig_confdir}/*.conf
%dir /usr/lib/fontconfig
%dir /usr/lib/fontconfig/cache
%{_mandir}/man1/*
%{_mandir}/man5/*
@ -188,16 +201,121 @@ fi
%{_datadir}/gettext/its/fontconfig.loc
%files devel-doc
%doc fontconfig-devel.txt fontconfig-devel
%doc fontconfig-devel.txt fontconfig-devel.html
%changelog
* Thu Mar 3 2022 Akira TAGOH <tagoh@redhat.com> - 2.13.94-5
- Fix the matching function for postscriptname property.
Resolves: rhbz#1946871
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.17.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Wed Mar 2 2022 Akira TAGOH <tagoh@redhat.com> - 2.13.94-4
- Fix a memory leak.
Resolves: rhbz#1914716
* Mon Jun 30 2025 Akira TAGOH <tagoh@redhat.com> - 2.17.0-2
- Backport a patch to fix a crash with Graphite fonts
- Drop 70-*bitmaps*.conf from /etc/fonts/conf.d so far.
Resolves: rhbz#2375426
* Fri Jun 27 2025 Akira TAGOH <tagoh@redhat.com> - 2.17.0-1
- New upstream release.
Resolves: rhbz#2375126
* Fri Apr 11 2025 Akira TAGOH <tagoh@redhat.com> - 2.16.2-1
- New upstream release.
* Thu Mar 13 2025 Akira TAGOH <tagoh@redhat.com> - 2.16.1-1
- New upstream release.
* Mon Jan 27 2025 Akira TAGOH <tagoh@redhat.com> - 2.16.0-2
- Fix endian detection.
Resolves: rhbz#2341757
* Sat Jan 18 2025 Akira TAGOH <tagoh@redhat.com> - 2.16.0-1
- New upstream release.
Resolves: rhbz#2338618
- Use meson instead of autotools to build.
- Disable meson test on s390x temporarily.
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.15.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Thu Aug 1 2024 Akira TAGOH <tagoh@redhat.com> - 2.15.0-8
- Fix a memory leak and potentially uninitialized values.
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.15.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Fri Jun 7 2024 Akira TAGOH <tagoh@redhat.com> - 2.15.0-6
- Own /usr/lib/fontconfig
Resolves: rhbz#2284076
* Mon Apr 29 2024 Michael Kuhn <suraia@fedoraproject.org> - 2.15.0-5
- Fix emoji fonts being disabled when bitmap fonts were disabled
* Sat Feb 10 2024 Akira TAGOH <tagoh@redhat.com> - 2.15.0-4
- Delete .uuid with fc-cache -f.
Resolves: rhbz#1761885
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.15.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.15.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Dec 22 2023 Akira TAGOH <tagoh@redhat.com> - 2.15.0-1
- New upstream release.
Resolves: rhbz#2255623
* Thu Aug 17 2023 Akira TAGOH <tagoh@redhat.com> - 2.14.2-5
- Update 65-nonlatin.conf to 69-nonlatin.conf
This basically provides substitutes for certain languages and is helpful
to determine default behavior though, we have per-package config for similar purpose.
Since 65 is mostly used for default fonts and this config prevents some behavior for
packages named something coming later than "nonlatin" in the alphabetical order.
So moving this to the safer priority.
This would fixes an issue, particularly Lohit Marathi vs Lohit Devanagari after
updating their priorities from 65 to 66.
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.14.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Fri Jun 16 2023 Akira TAGOH <tagoh@redhat.com> - 2.14.2-3
- Drop 10-sub-pixel-rgb-for-kde.conf
Resolves: rhbz#2212512
* Tue Apr 4 2023 Akira TAGOH <tagoh@redhat.com> - 2.14.2-2
- Migrated license tag to SPDX.
* Fri Jan 27 2023 Akira TAGOH <tagoh@redhat.com> - 2.14.2-1
- New upstream release.
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.14.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Nov 26 2022 Akira TAGOH <tagoh@redhat.com> - 2.14.1-2
- Enable RGB stripes layout for sub-pixel rendering on KDE only.
Resolves: rhbz#2137825
* Fri Oct 21 2022 Akira TAGOH <tagoh@redhat.com> - 2.14.1-1
- New upstream release.
* Wed Sep 28 2022 Akira TAGOH <tagoh@redhat.com> - 2.14.0-3
- Remap font paths to other place properly.
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.14.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Mar 31 2022 Akira TAGOH <tagoh@redhat.com> - 2.14.0-1
- New upstream release.
* Fri Feb 4 2022 Akira TAGOH <tagoh@redhat.com> - 2.13.96-1
- New upstream release.
- Fix missing a file in the archive.
Resolves: rhbz#2050478
* Tue Feb 1 2022 Akira TAGOH <tagoh@redhat.com> - 2.13.95-1
- New upstream release.
- Update deps to font(notosans)
https://fedoraproject.org/wiki/Changes/DefaultToNotoFonts
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.13.94-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.13.94-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
@ -207,7 +325,7 @@ fi
- Enable 11-lcdfilter-default.conf.
Resolves: rhbz#1965684
* Thu Jun 29 2021 Akira TAGOH <tagoh@redhat.com> - 2.13.94-1
* Tue Jun 29 2021 Akira TAGOH <tagoh@redhat.com> - 2.13.94-1
- New upstream release.
* Thu Mar 25 2021 Akira TAGOH <tagoh@redhat.com> - 2.13.93-6

5
plans/basic.fmf Normal file
View file

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

View file

@ -1,2 +1 @@
SHA512 (fontconfig-2.13.93.tar.xz) = 1ba119ea3faba662e108df6fce22f242eb2b7c5ec087159ca0cb76944991b19563f744c181263343941c50547bc0c73c6437d5380df09b5029facaab80465b58
SHA512 (fontconfig-2.13.94.tar.xz) = f880c71d3fa59855a72baea7ee220dcb2067cf9afa2ee5c30b6b18a6f8252b6cb34ab8d7cd9f8631e63afbc5733ccb781ac089792217c4d98726960550e5ba37
SHA512 (fontconfig-2.17.0.tar.xz) = dd64905c3e0e5c5881df505b8f0bea594bbac5ce145f57aedcd7130978cd285491497198d8f2d6ed26f7b2abb31268dc3ff97aa75ce998b8e57f2d5c75b240b4

3
tests/basic/main.fmf Normal file
View file

@ -0,0 +1,3 @@
summary: Concise summary describing what the test does
test: ./test.sh
framework: beakerlib

22
tests/basic/test.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
. /usr/share/beakerlib/beakerlib.sh || exit 1
rlJournalStart
rlPhaseStartSetup
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "pushd $tmp"
rlRun "set -o pipefail"
rlPhaseEnd
rlPhaseStartTest
rlRun "fc-match" 0 "Check fc-match"
rlRun "fc-list" 0 "Check fc-list"
rlRun "fc-scan /usr/share/fonts" 0 "Check fc-scan"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
rlJournalEnd

View file

@ -1,14 +0,0 @@
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
required_packages:
- fontconfig
tests:
- fcmatch_test:
dir: .
run: fc-match
- fclist_test:
dir: .
run: fc-list