diff --git a/.fmf/version b/.fmf/version deleted file mode 100644 index d00491f..0000000 --- a/.fmf/version +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/.gitignore b/.gitignore index 8ea9665..da98c57 100644 --- a/.gitignore +++ b/.gitignore @@ -29,18 +29,3 @@ fontconfig-2.8.0.tar.gz /fontconfig-2.12.92.tar.bz2 /fontconfig-2.12.93.tar.bz2 /fontconfig-2.13.0.tar.bz2 -/fontconfig-2.13.1.tar.bz2 -/fontconfig-2.13.91.tar.xz -/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 diff --git a/fc-cache b/fc-cache index 8253ae7..6a12446 100755 --- a/fc-cache +++ b/fc-cache @@ -1,4 +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 "$@" || : +[ -x /usr/bin/fc-cache-32 ] && /usr/bin/fc-cache-32 $@ || : +[ -x /usr/bin/fc-cache-64 ] && /usr/bin/fc-cache-64 $@ || : diff --git a/fontconfig-const-name-in-range.patch b/fontconfig-const-name-in-range.patch new file mode 100644 index 0000000..728c2c3 --- /dev/null +++ b/fontconfig-const-name-in-range.patch @@ -0,0 +1,60 @@ +From 198358dd8ff858c9e36531a7406ccb2246ae77b7 Mon Sep 17 00:00:00 2001 +From: Akira TAGOH +Date: Mon, 12 Mar 2018 11:49:58 +0900 +Subject: [PATCH] Allow the constant names in the range + +https://bugs.freedesktop.org/show_bug.cgi?id=105415 +--- + src/fcname.c | 34 +++++++++++++++++++++++++++++----- + 1 file changed, 29 insertions(+), 5 deletions(-) + +diff --git a/src/fcname.c b/src/fcname.c +index 79e413e..15fb659 100644 +--- a/src/fcname.c ++++ b/src/fcname.c +@@ -330,13 +330,37 @@ 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); +-- +2.14.3 + diff --git a/fontconfig-disable-network-required-test.patch b/fontconfig-disable-network-required-test.patch deleted file mode 100644 index e048b49..0000000 --- a/fontconfig-disable-network-required-test.patch +++ /dev/null @@ -1,113 +0,0 @@ -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" ] - --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 "$(fdate ${SOURCE_DATE_EPOCH})" "$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 "$(fdate ${SOURCE_DATE_EPOCH})" "$FONTDIR" -+# fi -+# "$BUILDTESTDIR"/test-crbug1004254 -+#else - echo "No test-crbug1004254: skipped" --fi -+#fi - - if [ "x$EXEEXT" = "x" ]; then - diff --git a/fontconfig-drop-lang-from-pkgkit-format.patch b/fontconfig-drop-lang-from-pkgkit-format.patch deleted file mode 100644 index abece6d..0000000 --- a/fontconfig-drop-lang-from-pkgkit-format.patch +++ /dev/null @@ -1,12 +0,0 @@ -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:-|basename}: \"%{family[0]:-}\" \"%{style[0]:-}\"" - #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, ...) diff --git a/fontconfig-fix-bz1634245.patch b/fontconfig-fix-bz1634245.patch new file mode 100644 index 0000000..a69f577 --- /dev/null +++ b/fontconfig-fix-bz1634245.patch @@ -0,0 +1,503 @@ +From fa13f8835c2819e693c7250e0d6729e22f0509c2 Mon Sep 17 00:00:00 2001 +From: Behdad Esfahbod +Date: Sat, 31 Mar 2018 18:36:20 +0200 +Subject: [PATCH 1/2] Fix name scanning + +In 161c738 I switched from linear name scanning to binary searching. +That, however, ignored the fact that there might be more than one +name table entry for each pair we want to query. + +To fix that and retain bsearch, I now get all name entries first, +sort them, and use for bsearching. + +This fixes https://bugs.freedesktop.org/show_bug.cgi?id=105756 + +This makes scaning Voto Serif GX twice slower though, since we are +creating and sorting the list for each instance. In the next commit, +I'll share this list across different instances to fix this. +--- + src/fcfreetype.c | 293 ++++++++++++++++++++++++++++++----------------- + 1 file changed, 185 insertions(+), 108 deletions(-) + +diff --git a/src/fcfreetype.c b/src/fcfreetype.c +index 36f5aed..9302aed 100644 +--- a/src/fcfreetype.c ++++ b/src/fcfreetype.c +@@ -1136,30 +1136,65 @@ static const FT_UShort nameid_order[] = { + + #define NUM_NAMEID_ORDER (sizeof (nameid_order) / sizeof (nameid_order[0])) + +-static FcBool +-FcFreeTypeGetName (const FT_Face face, +- unsigned int platform, +- unsigned int nameid, +- FT_SfntName *sname) ++typedef struct ++{ ++ unsigned int platform_id; ++ unsigned int name_id; ++ unsigned int encoding_id; ++ unsigned int language_id; ++ unsigned int idx; ++} FcNameMapping; ++ ++static int ++name_mapping_cmp (const void *pa, const void *pb) + { +- int min = 0, max = (int) FT_Get_Sfnt_Name_Count (face) - 1; ++ const FcNameMapping *a = (const FcNameMapping *) pa; ++ const FcNameMapping *b = (const FcNameMapping *) pb; ++ ++ if (a->platform_id != b->platform_id) return (int) a->platform_id - (int) b->platform_id; ++ if (a->name_id != b->name_id) return (int) a->name_id - (int) b->name_id; ++ if (a->encoding_id != b->encoding_id) return (int) a->encoding_id - (int) b->encoding_id; ++ if (a->language_id != b->language_id) return (int) a->language_id - (int) b->language_id; ++ if (a->idx != b->idx) return (int) a->idx - (int) b->idx; ++ ++ return 0; ++} ++ ++static int ++FcFreeTypeGetFirstName (const FT_Face face, ++ unsigned int platform, ++ unsigned int nameid, ++ FcNameMapping *mapping, ++ unsigned int count, ++ FT_SfntName *sname) ++{ ++ int min = 0, max = (int) count - 1; + + while (min <= max) + { + int mid = (min + max) / 2; + +- if (FT_Get_Sfnt_Name (face, mid, sname) != 0) ++ if (FT_Get_Sfnt_Name (face, mapping[mid].idx, sname) != 0) + return FcFalse; + +- if (platform < sname->platform_id || (platform == sname->platform_id && nameid < sname->name_id)) ++ if (platform < sname->platform_id || ++ (platform == sname->platform_id && ++ (nameid < sname->name_id || ++ (nameid == sname->name_id && ++ (mid && ++ platform == mapping[mid - 1].platform_id && ++ nameid == mapping[mid - 1].name_id ++ ))))) + max = mid - 1; +- else if (platform > sname->platform_id || (platform == sname->platform_id && nameid > sname->name_id)) ++ else if (platform > sname->platform_id || ++ (platform == sname->platform_id && ++ nameid > sname->name_id)) + min = mid + 1; + else +- return FcTrue; ++ return mid; + } + +- return FcFalse; ++ return -1; + } + + static FcPattern * +@@ -1180,6 +1215,7 @@ FcFreeTypeQueryFaceInternal (const FT_Face face, + FcBool variable_size = FcFalse; + FcCharSet *cs; + FcLangSet *ls; ++ FcNameMapping *name_mapping = 0; + #if 0 + FcChar8 *family = 0; + #endif +@@ -1203,6 +1239,7 @@ FcFreeTypeQueryFaceInternal (const FT_Face face, + TT_Header *head; + const FcChar8 *exclusiveLang = 0; + ++ int name_count = 0; + int nfamily = 0; + int nfamily_lang = 0; + int nstyle = 0; +@@ -1369,6 +1406,36 @@ FcFreeTypeQueryFaceInternal (const FT_Face face, + * and style names. FreeType makes quite a hash + * of them + */ ++ name_count = FT_Get_Sfnt_Name_Count (face); ++ if (!name_mapping) ++ { ++ int i = 0; ++ name_mapping = malloc (name_count * sizeof (FcNameMapping)); ++ if (!name_mapping) ++ name_count = 0; ++ for (i = 0; i < name_count; i++) ++ { ++ FcNameMapping *p = &name_mapping[i]; ++ FT_SfntName sname; ++ if (FT_Get_Sfnt_Name (face, i, &sname) == 0) ++ { ++ p->platform_id = sname.platform_id; ++ p->name_id = sname.name_id; ++ p->encoding_id = sname.encoding_id; ++ p->language_id = sname.language_id; ++ p->idx = i; ++ } ++ else ++ { ++ p->platform_id = ++ p->name_id = ++ p->encoding_id = ++ p->language_id = ++ p->idx = (unsigned int) -1; ++ } ++ } ++ qsort (name_mapping, name_count, sizeof(FcNameMapping), name_mapping_cmp); ++ } + for (p = 0; p < NUM_PLATFORM_ORDER; p++) + { + int platform = platform_order[p]; +@@ -1380,6 +1447,7 @@ FcFreeTypeQueryFaceInternal (const FT_Face face, + for (n = 0; n < NUM_NAMEID_ORDER; n++) + { + FT_SfntName sname; ++ int nameidx; + const FcChar8 *lang; + const char *elt = 0, *eltlang = 0; + int *np = 0, *nlangp = 0; +@@ -1401,119 +1469,128 @@ FcFreeTypeQueryFaceInternal (const FT_Face face, + lookupid = instance->strid; + } + +- if (!FcFreeTypeGetName (face, platform, lookupid, &sname)) ++ nameidx = FcFreeTypeGetFirstName (face, platform, lookupid, ++ name_mapping, name_count, ++ &sname); ++ if (nameidx == -1) + continue; +- +- switch (nameid) { +- case TT_NAME_ID_WWS_FAMILY: +- case TT_NAME_ID_PREFERRED_FAMILY: +- case TT_NAME_ID_FONT_FAMILY: ++ do ++ { ++ switch (nameid) { ++ case TT_NAME_ID_WWS_FAMILY: ++ case TT_NAME_ID_PREFERRED_FAMILY: ++ case TT_NAME_ID_FONT_FAMILY: + #if 0 +- case TT_NAME_ID_UNIQUE_ID: ++ case TT_NAME_ID_UNIQUE_ID: + #endif +- if (FcDebug () & FC_DBG_SCANV) +- printf ("found family (n %2d p %d e %d l 0x%04x)", +- sname.name_id, sname.platform_id, +- sname.encoding_id, sname.language_id); +- +- elt = FC_FAMILY; +- eltlang = FC_FAMILYLANG; +- np = &nfamily; +- nlangp = &nfamily_lang; +- break; +- case TT_NAME_ID_MAC_FULL_NAME: +- case TT_NAME_ID_FULL_NAME: +- if (FcDebug () & FC_DBG_SCANV) +- printf ("found full (n %2d p %d e %d l 0x%04x)", +- sname.name_id, sname.platform_id, +- sname.encoding_id, sname.language_id); +- +- elt = FC_FULLNAME; +- eltlang = FC_FULLNAMELANG; +- np = &nfullname; +- nlangp = &nfullname_lang; +- break; +- case TT_NAME_ID_WWS_SUBFAMILY: +- case TT_NAME_ID_PREFERRED_SUBFAMILY: +- case TT_NAME_ID_FONT_SUBFAMILY: +- if (variable) ++ if (FcDebug () & FC_DBG_SCANV) ++ printf ("found family (n %2d p %d e %d l 0x%04x)", ++ sname.name_id, sname.platform_id, ++ sname.encoding_id, sname.language_id); ++ ++ elt = FC_FAMILY; ++ eltlang = FC_FAMILYLANG; ++ np = &nfamily; ++ nlangp = &nfamily_lang; ++ break; ++ case TT_NAME_ID_MAC_FULL_NAME: ++ case TT_NAME_ID_FULL_NAME: ++ if (FcDebug () & FC_DBG_SCANV) ++ printf ("found full (n %2d p %d e %d l 0x%04x)", ++ sname.name_id, sname.platform_id, ++ sname.encoding_id, sname.language_id); ++ ++ elt = FC_FULLNAME; ++ eltlang = FC_FULLNAMELANG; ++ np = &nfullname; ++ nlangp = &nfullname_lang; ++ break; ++ case TT_NAME_ID_WWS_SUBFAMILY: ++ case TT_NAME_ID_PREFERRED_SUBFAMILY: ++ case TT_NAME_ID_FONT_SUBFAMILY: ++ if (variable) ++ break; ++ if (FcDebug () & FC_DBG_SCANV) ++ printf ("found style (n %2d p %d e %d l 0x%04x) ", ++ sname.name_id, sname.platform_id, ++ sname.encoding_id, sname.language_id); ++ ++ elt = FC_STYLE; ++ eltlang = FC_STYLELANG; ++ np = &nstyle; ++ nlangp = &nstyle_lang; ++ break; ++ case TT_NAME_ID_TRADEMARK: ++ case TT_NAME_ID_MANUFACTURER: ++ /* If the foundry wasn't found in the OS/2 table, look here */ ++ if(!foundry) ++ { ++ FcChar8 *utf8; ++ utf8 = FcSfntNameTranscode (&sname); ++ foundry = FcNoticeFoundry((FT_String *) utf8); ++ free (utf8); ++ } + break; +- if (FcDebug () & FC_DBG_SCANV) +- printf ("found style (n %2d p %d e %d l 0x%04x) ", +- sname.name_id, sname.platform_id, +- sname.encoding_id, sname.language_id); +- +- elt = FC_STYLE; +- eltlang = FC_STYLELANG; +- np = &nstyle; +- nlangp = &nstyle_lang; +- break; +- case TT_NAME_ID_TRADEMARK: +- case TT_NAME_ID_MANUFACTURER: +- /* If the foundry wasn't found in the OS/2 table, look here */ +- if(!foundry) +- { +- FcChar8 *utf8; +- utf8 = FcSfntNameTranscode (&sname); +- foundry = FcNoticeFoundry((FT_String *) utf8); +- free (utf8); + } +- break; +- } +- if (elt) +- { +- FcChar8 *utf8, *pp; +- +- utf8 = FcSfntNameTranscode (&sname); +- lang = FcSfntNameLanguage (&sname); +- +- if (FcDebug () & FC_DBG_SCANV) +- printf ("%s\n", utf8); +- +- if (!utf8) +- continue; +- +- /* Trim surrounding whitespace. */ +- pp = utf8; +- while (*pp == ' ') +- pp++; +- len = strlen ((const char *) pp); +- memmove (utf8, pp, len + 1); +- pp = utf8 + len; +- while (pp > utf8 && *(pp - 1) == ' ') +- pp--; +- *pp = 0; +- +- if (FcStringInPatternElement (pat, elt, utf8)) ++ if (elt) + { +- free (utf8); +- continue; +- } ++ FcChar8 *utf8, *pp; + +- /* add new element */ +- if (!FcPatternAddString (pat, elt, utf8)) +- { ++ utf8 = FcSfntNameTranscode (&sname); ++ lang = FcSfntNameLanguage (&sname); ++ ++ if (FcDebug () & FC_DBG_SCANV) ++ printf ("%s\n", utf8); ++ ++ if (!utf8) ++ continue; ++ ++ /* Trim surrounding whitespace. */ ++ pp = utf8; ++ while (*pp == ' ') ++ pp++; ++ len = strlen ((const char *) pp); ++ memmove (utf8, pp, len + 1); ++ pp = utf8 + len; ++ while (pp > utf8 && *(pp - 1) == ' ') ++ pp--; ++ *pp = 0; ++ ++ if (FcStringInPatternElement (pat, elt, utf8)) ++ { ++ free (utf8); ++ continue; ++ } ++ ++ /* add new element */ ++ if (!FcPatternAddString (pat, elt, utf8)) ++ { ++ free (utf8); ++ goto bail1; ++ } + free (utf8); +- goto bail1; +- } +- free (utf8); +- if (lang) +- { +- /* pad lang list with 'und' to line up with elt */ +- while (*nlangp < *np) ++ if (lang) + { +- if (!FcPatternAddString (pat, eltlang, (FcChar8 *) "und")) ++ /* pad lang list with 'und' to line up with elt */ ++ while (*nlangp < *np) ++ { ++ if (!FcPatternAddString (pat, eltlang, (FcChar8 *) "und")) ++ goto bail1; ++ ++*nlangp; ++ } ++ if (!FcPatternAddString (pat, eltlang, lang)) + goto bail1; + ++*nlangp; + } +- if (!FcPatternAddString (pat, eltlang, lang)) +- goto bail1; +- ++*nlangp; ++ ++*np; + } +- ++*np; + } ++ while (++nameidx < name_count && ++ FT_Get_Sfnt_Name (face, name_mapping[nameidx].idx, &sname) == 0 && ++ platform == sname.platform_id && lookupid == sname.name_id); + } + } ++ free (name_mapping); + + if (!nfamily && face->family_name && + FcStrCmpIgnoreBlanksAndCase ((FcChar8 *) face->family_name, (FcChar8 *) "") != 0) +-- +2.17.1 + +From a8a6efa805fc03e790214e8a0bc55843a258d774 Mon Sep 17 00:00:00 2001 +From: Behdad Esfahbod +Date: Sat, 31 Mar 2018 19:19:36 +0200 +Subject: [PATCH 2/2] Share name-mapping across instances + +Continuation of previous commit. + +Makes scanning Voto Serif GX fast again. +--- + src/fcfreetype.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +diff --git a/src/fcfreetype.c b/src/fcfreetype.c +index 9302aed..0c2f266 100644 +--- a/src/fcfreetype.c ++++ b/src/fcfreetype.c +@@ -1202,7 +1202,8 @@ FcFreeTypeQueryFaceInternal (const FT_Face face, + const FcChar8 *file, + unsigned int id, + FcCharSet **cs_share, +- FcLangSet **ls_share) ++ FcLangSet **ls_share, ++ FcNameMapping **nm_share) + { + FcPattern *pat; + int slant = -1; +@@ -1215,7 +1216,7 @@ FcFreeTypeQueryFaceInternal (const FT_Face face, + FcBool variable_size = FcFalse; + FcCharSet *cs; + FcLangSet *ls; +- FcNameMapping *name_mapping = 0; ++ FcNameMapping *name_mapping = NULL; + #if 0 + FcChar8 *family = 0; + #endif +@@ -1407,6 +1408,8 @@ FcFreeTypeQueryFaceInternal (const FT_Face face, + * of them + */ + name_count = FT_Get_Sfnt_Name_Count (face); ++ if (nm_share) ++ name_mapping = *nm_share; + if (!name_mapping) + { + int i = 0; +@@ -1435,6 +1438,9 @@ FcFreeTypeQueryFaceInternal (const FT_Face face, + } + } + qsort (name_mapping, name_count, sizeof(FcNameMapping), name_mapping_cmp); ++ ++ if (nm_share) ++ *nm_share = name_mapping; + } + for (p = 0; p < NUM_PLATFORM_ORDER; p++) + { +@@ -1590,7 +1596,8 @@ FcFreeTypeQueryFaceInternal (const FT_Face face, + platform == sname.platform_id && lookupid == sname.name_id); + } + } +- free (name_mapping); ++ if (!nm_share) ++ free (name_mapping); + + if (!nfamily && face->family_name && + FcStrCmpIgnoreBlanksAndCase ((FcChar8 *) face->family_name, (FcChar8 *) "") != 0) +@@ -2112,7 +2119,7 @@ FcFreeTypeQueryFace (const FT_Face face, + unsigned int id, + FcBlanks *blanks FC_UNUSED) + { +- return FcFreeTypeQueryFaceInternal (face, file, id, NULL, NULL); ++ return FcFreeTypeQueryFaceInternal (face, file, id, NULL, NULL, NULL); + } + + FcPattern * +@@ -2134,7 +2141,7 @@ FcFreeTypeQuery(const FcChar8 *file, + if (count) + *count = face->num_faces; + +- pat = FcFreeTypeQueryFaceInternal (face, file, id, NULL, NULL); ++ pat = FcFreeTypeQueryFaceInternal (face, file, id, NULL, NULL, NULL); + + FT_Done_Face (face); + bail: +@@ -2153,6 +2160,7 @@ FcFreeTypeQueryAll(const FcChar8 *file, + FT_Library ftLibrary = NULL; + FcCharSet *cs = NULL; + FcLangSet *ls = NULL; ++ FcNameMapping *nm = NULL; + FT_MM_Var *mm_var = NULL; + FcBool index_set = id != (unsigned int) -1; + unsigned int set_face_num = index_set ? id & 0xFFFF : 0; +@@ -2212,7 +2220,7 @@ FcFreeTypeQueryAll(const FcChar8 *file, + } + + id = ((instance_num << 16) + face_num); +- pat = FcFreeTypeQueryFaceInternal (face, (const FcChar8 *) file, id, &cs, &ls); ++ pat = FcFreeTypeQueryFaceInternal (face, (const FcChar8 *) file, id, &cs, &ls, &nm); + + if (pat) + { +@@ -2231,6 +2239,8 @@ skip: + instance_num = 0x8000; /* variable font */ + else + { ++ free (nm); ++ nm = NULL; + FcLangSetDestroy (ls); + ls = NULL; + FcCharSetDestroy (cs); +-- +2.17.1 + diff --git a/fontconfig-fix-crash.patch b/fontconfig-fix-crash.patch deleted file mode 100644 index c52b33d..0000000 --- a/fontconfig-fix-crash.patch +++ /dev/null @@ -1,28 +0,0 @@ -From b9bec06d73340f1b5727302d13ac3df307b7febc Mon Sep 17 00:00:00 2001 -From: Akira TAGOH -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 - diff --git a/fontconfig-fix-embolden-logic.patch b/fontconfig-fix-embolden-logic.patch new file mode 100644 index 0000000..766b7be --- /dev/null +++ b/fontconfig-fix-embolden-logic.patch @@ -0,0 +1,31 @@ +From 454923709a1a1e480554c400e053aea9a1ba951a Mon Sep 17 00:00:00 2001 +From: Akira TAGOH +Date: Thu, 10 May 2018 22:01:29 +0900 +Subject: [PATCH] Change the emboldening logic again + +enable emboldening when request was >= bold and font was <= medium + +https://bugs.freedesktop.org/show_bug.cgi?id=106460 +--- + conf.d/90-synthetic.conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/conf.d/90-synthetic.conf b/conf.d/90-synthetic.conf +index e344e4a..6b929dd 100644 +--- a/conf.d/90-synthetic.conf ++++ b/conf.d/90-synthetic.conf +@@ -42,9 +42,9 @@ + --> + + +- ++ + +- regular ++ medium + + + +-- +2.17.0 + diff --git a/fontconfig-implicit-object-for-const-name.patch b/fontconfig-implicit-object-for-const-name.patch new file mode 100644 index 0000000..8dbde51 --- /dev/null +++ b/fontconfig-implicit-object-for-const-name.patch @@ -0,0 +1,31 @@ +From 4699406a68321179b14fae7412f828e2f37a7033 Mon Sep 17 00:00:00 2001 +From: Akira TAGOH +Date: Wed, 14 Mar 2018 18:31:30 +0900 +Subject: [PATCH 2/5] Add the value of the constant name to the implicit object + in the pattern + +For objects which has been changed the object type to FcTypeRange. + +https://bugs.freedesktop.org/show_bug.cgi?id=105415 +--- + src/fcname.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/fcname.c b/src/fcname.c +index 15fb659..c9320ae 100644 +--- a/src/fcname.c ++++ b/src/fcname.c +@@ -490,6 +490,10 @@ FcNameParse (const FcChar8 *name) + if (!FcPatternAddBool (pat, c->object, c->value)) + goto bail2; + break; ++ case FcTypeRange: ++ if (!FcPatternAddInteger (pat, c->object, c->value)) ++ goto bail2; ++ break; + default: + break; + } +-- +2.14.3 + diff --git a/fontconfig-locale.patch b/fontconfig-locale.patch new file mode 100644 index 0000000..c63a717 --- /dev/null +++ b/fontconfig-locale.patch @@ -0,0 +1,274 @@ +From 923b5be626a6e03fbaeee0b5cd6d0246c2f8f36f Mon Sep 17 00:00:00 2001 +From: Akira TAGOH +Date: Wed, 14 Mar 2018 12:35:05 +0900 +Subject: [PATCH 1/5] Do not override locale if already set by app + +https://bugs.freedesktop.org/show_bug.cgi?id=105492 +--- + src/fccfg.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/fccfg.c b/src/fccfg.c +index eb0b76d..e311f17 100644 +--- a/src/fccfg.c ++++ b/src/fccfg.c +@@ -45,11 +45,16 @@ retry_locale: + is_locale_initialized = (intptr_t) fc_atomic_ptr_get (&static_is_locale_initialized); + if (!is_locale_initialized) + { ++ char *loc; ++ + is_locale_initialized = FcTrue; + if (!fc_atomic_ptr_cmpexch (&static_is_locale_initialized, NULL, + (void *)(intptr_t) is_locale_initialized)) + goto retry_locale; +- setlocale (LC_ALL, ""); ++ ++ loc = setlocale (LC_ALL, NULL); ++ if (!loc || strcmp (loc, "C") == 0) ++ setlocale (LC_ALL, ""); + } + retry_config: + config = fc_atomic_ptr_get (&_fcConfig); +-- +2.14.3 + +From 98eaef69af1350e459bf9c175476d3b772968874 Mon Sep 17 00:00:00 2001 +From: Akira TAGOH +Date: Thu, 15 Mar 2018 12:17:52 +0900 +Subject: [PATCH 4/5] Leave the locale setting to applications + +https://bugs.freedesktop.org/show_bug.cgi?id=105492 +--- + fc-conflist/fc-conflist.c | 2 ++ + src/fccfg.c | 22 ++-------------------- + 2 files changed, 4 insertions(+), 20 deletions(-) + +diff --git a/fc-conflist/fc-conflist.c b/fc-conflist/fc-conflist.c +index d02273b..5c40a0f 100644 +--- a/fc-conflist/fc-conflist.c ++++ b/fc-conflist/fc-conflist.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #ifdef ENABLE_NLS + #include +@@ -102,6 +103,7 @@ main (int argc, char **argv) + #if HAVE_GETOPT_LONG || HAVE_GETOPT + int c; + ++ setlocale (LC_ALL, ""); + #if HAVE_GETOPT_LONG + while ((c = getopt_long (argc, argv, "Vh", longopts, NULL)) != -1) + #else +diff --git a/src/fccfg.c b/src/fccfg.c +index e311f17..e35c451 100644 +--- a/src/fccfg.c ++++ b/src/fccfg.c +@@ -26,7 +26,6 @@ + + #include "fcint.h" + #include +-#include + #include + + #if defined (_WIN32) && !defined (R_OK) +@@ -39,24 +38,7 @@ static FcConfig * + FcConfigEnsure (void) + { + FcConfig *config; +- FcBool is_locale_initialized; +- static void *static_is_locale_initialized; +-retry_locale: +- is_locale_initialized = (intptr_t) fc_atomic_ptr_get (&static_is_locale_initialized); +- if (!is_locale_initialized) +- { +- char *loc; +- +- is_locale_initialized = FcTrue; +- if (!fc_atomic_ptr_cmpexch (&static_is_locale_initialized, NULL, +- (void *)(intptr_t) is_locale_initialized)) +- goto retry_locale; +- +- loc = setlocale (LC_ALL, NULL); +- if (!loc || strcmp (loc, "C") == 0) +- setlocale (LC_ALL, ""); +- } +-retry_config: ++retry: + config = fc_atomic_ptr_get (&_fcConfig); + if (!config) + { +@@ -64,7 +46,7 @@ retry_config: + + if (!fc_atomic_ptr_cmpexch (&_fcConfig, NULL, config)) { + FcConfigDestroy (config); +- goto retry_config; ++ goto retry; + } + } + return config; +-- +2.14.3 + +From 2938e4d72da40f6bb0d22086c519a9852a820f40 Mon Sep 17 00:00:00 2001 +From: Akira TAGOH +Date: Thu, 15 Mar 2018 12:54:02 +0900 +Subject: [PATCH 5/5] call setlocale + +--- + fc-cache/fc-cache.c | 2 ++ + fc-cat/fc-cat.c | 2 ++ + fc-list/fc-list.c | 2 ++ + fc-match/fc-match.c | 2 ++ + fc-pattern/fc-pattern.c | 2 ++ + fc-query/fc-query.c | 2 ++ + fc-scan/fc-scan.c | 2 ++ + 7 files changed, 14 insertions(+) + +diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c +index dc93c19..87e3020 100644 +--- a/fc-cache/fc-cache.c ++++ b/fc-cache/fc-cache.c +@@ -41,6 +41,7 @@ + #include + #include + #include ++#include + + #if defined (_WIN32) + #define STRICT +@@ -302,6 +303,7 @@ main (int argc, char **argv) + #if HAVE_GETOPT_LONG || HAVE_GETOPT + int c; + ++ setlocale (LC_ALL, ""); + #if HAVE_GETOPT_LONG + while ((c = getopt_long (argc, argv, "Efrsy:Vvh", longopts, NULL)) != -1) + #else +diff --git a/fc-cat/fc-cat.c b/fc-cat/fc-cat.c +index dfe30d7..69611bc 100644 +--- a/fc-cat/fc-cat.c ++++ b/fc-cat/fc-cat.c +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + + #ifdef ENABLE_NLS + #include +@@ -271,6 +272,7 @@ main (int argc, char **argv) + #if HAVE_GETOPT_LONG || HAVE_GETOPT + int c; + ++ setlocale (LC_ALL, ""); + #if HAVE_GETOPT_LONG + while ((c = getopt_long (argc, argv, "Vvrh", longopts, NULL)) != -1) + #else +diff --git a/fc-list/fc-list.c b/fc-list/fc-list.c +index 5cded50..2039acd 100644 +--- a/fc-list/fc-list.c ++++ b/fc-list/fc-list.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #ifdef HAVE_CONFIG_H + #include + #else +@@ -117,6 +118,7 @@ main (int argc, char **argv) + #if HAVE_GETOPT_LONG || HAVE_GETOPT + int c; + ++ setlocale (LC_ALL, ""); + #if HAVE_GETOPT_LONG + while ((c = getopt_long (argc, argv, "vbf:qVh", longopts, NULL)) != -1) + #else +diff --git a/fc-match/fc-match.c b/fc-match/fc-match.c +index 7902707..dee6147 100644 +--- a/fc-match/fc-match.c ++++ b/fc-match/fc-match.c +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + + #ifdef ENABLE_NLS + #include +@@ -121,6 +122,7 @@ main (int argc, char **argv) + #if HAVE_GETOPT_LONG || HAVE_GETOPT + int c; + ++ setlocale (LC_ALL, ""); + #if HAVE_GETOPT_LONG + while ((c = getopt_long (argc, argv, "asvbf:Vh", longopts, NULL)) != -1) + #else +diff --git a/fc-pattern/fc-pattern.c b/fc-pattern/fc-pattern.c +index f63761c..7989b81 100644 +--- a/fc-pattern/fc-pattern.c ++++ b/fc-pattern/fc-pattern.c +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + + #ifdef ENABLE_NLS + #include +@@ -111,6 +112,7 @@ main (int argc, char **argv) + #if HAVE_GETOPT_LONG || HAVE_GETOPT + int c; + ++ setlocale (LC_ALL, ""); + #if HAVE_GETOPT_LONG + while ((c = getopt_long (argc, argv, "cdf:Vh", longopts, NULL)) != -1) + #else +diff --git a/fc-query/fc-query.c b/fc-query/fc-query.c +index 9da090d..fbffb84 100644 +--- a/fc-query/fc-query.c ++++ b/fc-query/fc-query.c +@@ -39,6 +39,7 @@ + #include + #include + #include ++#include + + #ifdef ENABLE_NLS + #include +@@ -115,6 +116,7 @@ main (int argc, char **argv) + #if HAVE_GETOPT_LONG || HAVE_GETOPT + int c; + ++ setlocale (LC_ALL, ""); + #if HAVE_GETOPT_LONG + while ((c = getopt_long (argc, argv, "i:bf:Vh", longopts, NULL)) != -1) + #else +diff --git a/fc-scan/fc-scan.c b/fc-scan/fc-scan.c +index edb967c..9302ac5 100644 +--- a/fc-scan/fc-scan.c ++++ b/fc-scan/fc-scan.c +@@ -39,6 +39,7 @@ + #include + #include + #include ++#include + + #ifdef ENABLE_NLS + #include +@@ -110,6 +111,7 @@ main (int argc, char **argv) + #if HAVE_GETOPT_LONG || HAVE_GETOPT + int c; + ++ setlocale (LC_ALL, ""); + #if HAVE_GETOPT_LONG + while ((c = getopt_long (argc, argv, "bf:Vh", longopts, NULL)) != -1) + #else +-- +2.14.3 + diff --git a/fontconfig-lower-nonlatin-conf.patch b/fontconfig-lower-nonlatin-conf.patch deleted file mode 100644 index 3ff373a..0000000 --- a/fontconfig-lower-nonlatin-conf.patch +++ /dev/null @@ -1,42 +0,0 @@ -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', diff --git a/fontconfig-required-freetype-version.patch b/fontconfig-required-freetype-version.patch new file mode 100644 index 0000000..6f7aae3 --- /dev/null +++ b/fontconfig-required-freetype-version.patch @@ -0,0 +1,14 @@ +diff -pruN fontconfig-2.12.93.orig/configure.ac fontconfig-2.12.93/configure.ac +--- fontconfig-2.12.93.orig/configure.ac 2018-02-15 22:01:54.000000000 +0900 ++++ fontconfig-2.12.93/configure.ac 2018-02-15 22:33:42.353941393 +0900 +@@ -308,8 +308,8 @@ AC_DEFINE_UNQUOTED(USE_ICONV,$use_iconv, + # Checks for FreeType + # + dnl See http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/VERSIONS.TXT for versioning in freetype +-PKG_CHECK_MODULES(FREETYPE, freetype2 >= 21.0.15) +-PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES freetype2 >= 21.0.15" ++PKG_CHECK_MODULES(FREETYPE, freetype2 >= 20.0.14) ++PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES freetype2 >= 20.0.14" + + AC_SUBST(FREETYPE_LIBS) + AC_SUBST(FREETYPE_CFLAGS) diff --git a/fontconfig.spec b/fontconfig.spec index 1bc63c7..c472b97 100644 --- a/fontconfig.spec +++ b/fontconfig.spec @@ -1,46 +1,39 @@ -# ifdef'd in source code but runtime dep will be made for FT_Done_MM_Var symbol in freetype-2.9.1 -# so update the build deps as well to keep deps consistency between runtime and build time. -%global freetype_version 2.9.1 +%global freetype_version 2.8-7 Summary: Font configuration and customization library Name: fontconfig -Version: 2.17.0 -Release: 3%{?dist} +Version: 2.13.0 +Release: 5%{?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: HPND AND LicenseRef-Fedora-Public-Domain AND Unicode-DFS-2016 -Source: http://fontconfig.org/release/%{name}-%{version}.tar.xz +License: MIT and Public Domain and UCD +Source: http://fontconfig.org/release/%{name}-%{version}.tar.bz2 URL: http://fontconfig.org Source1: 25-no-bitmap-fedora.conf Source2: fc-cache # https://bugzilla.redhat.com/show_bug.cgi?id=140335 Patch0: %{name}-sleep-less.patch -Patch4: %{name}-drop-lang-from-pkgkit-format.patch -Patch5: %{name}-disable-network-required-test.patch -Patch6: %{name}-lower-nonlatin-conf.patch -Patch7: %{name}-fix-crash.patch +Patch1: %{name}-required-freetype-version.patch +Patch2: %{name}-const-name-in-range.patch +Patch3: %{name}-implicit-object-for-const-name.patch +Patch4: %{name}-locale.patch +Patch5: %{name}-fix-embolden-logic.patch +Patch6: %{name}-fix-bz1634245.patch -BuildRequires: libxml2-devel +BuildRequires: expat-devel BuildRequires: freetype-devel >= %{freetype_version} BuildRequires: fontpackages-devel -BuildRequires: gettext +BuildRequires: libuuid-devel +BuildRequires: autoconf automake libtool gettext itstool BuildRequires: gperf -BuildRequires: docbook-utils docbook-utils-pdf -BuildRequires: meson ninja-build gcc -Requires: fonts-filesystem freetype -# Register DTD system-wide to make validation work by default -# (used by fonts-rpm-macros) -Requires(pre): xml-common -Requires(postun): xml-common -PreReq: freetype >= 2.9.1-6 +Requires: fontpackages-filesystem freetype +Requires(pre): freetype >= 2.8-7 Requires(post): grep coreutils Requires: font(:lang=en) -Suggests: font(notosans) %description Fontconfig is designed to locate fonts within the @@ -49,6 +42,7 @@ applications. %package devel Summary: Font configuration and customization library +Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} Requires: freetype-devel >= %{freetype_version} Requires: pkgconfig @@ -63,6 +57,7 @@ will use fontconfig. %package devel-doc Summary: Development Documentation files for fontconfig library +Group: Documentation BuildArch: noarch Requires: %{name}-devel = %{version}-%{release} @@ -72,57 +67,33 @@ 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 -%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 +# We don't want to rebuild the docs, but we want to install the included ones. +export HASDOCBOOK=no + +autoreconf +%configure --with-add-fonts=/usr/share/X11/fonts/Type1,/usr/share/X11/fonts/TTF,/usr/local/share/fonts \ + --disable-static --with-cache-dir=/usr/lib/fontconfig/cache + +make %{?_smp_mflags} %install -%meson_install +make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" + +find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' 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}/ -# 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 +# 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/ # rename fc-cache binary mv $RPM_BUILD_ROOT%{_bindir}/fc-cache $RPM_BUILD_ROOT%{_bindir}/fc-cache-%{__isa_bits} -# create link to man page -echo ".so man1/fc-cache.1" > $RPM_BUILD_ROOT%{_mandir}/man1/fc-cache-%{__isa_bits}.1 - install -p -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/fc-cache %find_lang %{name} @@ -130,9 +101,11 @@ install -p -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/fc-cache cat %{name}-conf.lang >> %{name}.lang %check -%meson_test +make check %post +/sbin/ldconfig + umask 0022 mkdir -p /usr/lib/fontconfig/cache @@ -147,27 +120,16 @@ if [ -x /usr/bin/fc-cache ] && /usr/bin/fc-cache --version 2>&1 | grep -q %{vers HOME=/root /usr/bin/fc-cache -f fi +%postun -p /sbin/ldconfig + %transfiletriggerin -- /usr/share/fonts /usr/share/X11/fonts/Type1 /usr/share/X11/fonts/TTF /usr/local/share/fonts HOME=/root /usr/bin/fc-cache -s %transfiletriggerpostun -- /usr/share/fonts /usr/share/X11/fonts/Type1 /usr/share/X11/fonts/TTF /usr/local/share/fonts HOME=/root /usr/bin/fc-cache -s -%posttrans -if [ -e %{_sysconfdir}/xml/catalog ]; then - %{_bindir}/xmlcatalog --noout --add system \ - "urn:fontconfig:fonts.dtd" \ - "file://%{_datadir}/xml/fontconfig/fonts.dtd" \ - %{_sysconfdir}/xml/catalog -fi - -%postun -if [ $1 == 0 ] && [ -e %{_sysconfdir}/xml/catalog ]; then - %{_bindir}/xmlcatalog --noout --del "urn:fontconfig:fonts.dtd" %{_sysconfdir}/xml/catalog -fi - %files -f %{name}.lang -%doc README.md AUTHORS +%doc README AUTHORS %doc fontconfig-user.txt fontconfig-user.html %doc %{_fontconfig_confdir}/README %license COPYING @@ -187,7 +149,6 @@ 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/* @@ -201,243 +162,11 @@ fi %{_datadir}/gettext/its/fontconfig.loc %files devel-doc -%doc fontconfig-devel.txt fontconfig-devel.html +%doc fontconfig-devel.txt fontconfig-devel %changelog -* Wed Jul 23 2025 Fedora Release Engineering - 2.17.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Mon Jun 30 2025 Akira TAGOH - 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 - 2.17.0-1 -- New upstream release. - Resolves: rhbz#2375126 - -* Fri Apr 11 2025 Akira TAGOH - 2.16.2-1 -- New upstream release. - -* Thu Mar 13 2025 Akira TAGOH - 2.16.1-1 -- New upstream release. - -* Mon Jan 27 2025 Akira TAGOH - 2.16.0-2 -- Fix endian detection. - Resolves: rhbz#2341757 - -* Sat Jan 18 2025 Akira TAGOH - 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 - 2.15.0-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Thu Aug 1 2024 Akira TAGOH - 2.15.0-8 -- Fix a memory leak and potentially uninitialized values. - -* Wed Jul 17 2024 Fedora Release Engineering - 2.15.0-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Fri Jun 7 2024 Akira TAGOH - 2.15.0-6 -- Own /usr/lib/fontconfig - Resolves: rhbz#2284076 - -* Mon Apr 29 2024 Michael Kuhn - 2.15.0-5 -- Fix emoji fonts being disabled when bitmap fonts were disabled - -* Sat Feb 10 2024 Akira TAGOH - 2.15.0-4 -- Delete .uuid with fc-cache -f. - Resolves: rhbz#1761885 - -* Wed Jan 24 2024 Fedora Release Engineering - 2.15.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Fri Jan 19 2024 Fedora Release Engineering - 2.15.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Fri Dec 22 2023 Akira TAGOH - 2.15.0-1 -- New upstream release. - Resolves: rhbz#2255623 - -* Thu Aug 17 2023 Akira TAGOH - 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 - 2.14.2-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Fri Jun 16 2023 Akira TAGOH - 2.14.2-3 -- Drop 10-sub-pixel-rgb-for-kde.conf - Resolves: rhbz#2212512 - -* Tue Apr 4 2023 Akira TAGOH - 2.14.2-2 -- Migrated license tag to SPDX. - -* Fri Jan 27 2023 Akira TAGOH - 2.14.2-1 -- New upstream release. - -* Thu Jan 19 2023 Fedora Release Engineering - 2.14.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Sat Nov 26 2022 Akira TAGOH - 2.14.1-2 -- Enable RGB stripes layout for sub-pixel rendering on KDE only. - Resolves: rhbz#2137825 - -* Fri Oct 21 2022 Akira TAGOH - 2.14.1-1 -- New upstream release. - -* Wed Sep 28 2022 Akira TAGOH - 2.14.0-3 -- Remap font paths to other place properly. - -* Thu Jul 21 2022 Fedora Release Engineering - 2.14.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Thu Mar 31 2022 Akira TAGOH - 2.14.0-1 -- New upstream release. - -* Fri Feb 4 2022 Akira TAGOH - 2.13.96-1 -- New upstream release. -- Fix missing a file in the archive. - Resolves: rhbz#2050478 - -* Tue Feb 1 2022 Akira TAGOH - 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 - 2.13.94-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Wed Jul 21 2021 Fedora Release Engineering - 2.13.94-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Tue Jul 20 2021 Akira TAGOH - 2.13.94-2 -- Fix the score calculation on matching for multiple values. -- Enable 11-lcdfilter-default.conf. - Resolves: rhbz#1965684 - -* Tue Jun 29 2021 Akira TAGOH - 2.13.94-1 -- New upstream release. - -* Thu Mar 25 2021 Akira TAGOH - 2.13.93-6 -- Fix postun scriptlet to remove the entry from xml catalog. - -* Tue Jan 26 2021 Fedora Release Engineering - 2.13.93-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Wed Dec 23 2020 Akira TAGOH - 2.13.93-4 -- cherry pick some upstream patches - - Skip leading white space in style. - - Remove abort from FcCompareSize. - - Fix memory leaks - - Check qual and compare for family tests. -- -* Thu Dec 3 2020 Akira TAGOH - 2.13.93-3 -- Add back fullname property at the scan matching phase for the backward compatibility. - Resolves: rhbz#1902881 - -* Mon Nov 30 2020 Akira TAGOH - 2.13.93-2 -- Fix file conflicts. - -* Sat Nov 28 2020 Akira TAGOH - 2.13.93-1 -- New upstream release. - -* Mon Jul 27 2020 Fedora Release Engineering - 2.13.92-12 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Thu Apr 23 2020 Akira TAGOH - 2.13.92-11 -- deal with system caches as always latest on Silverblue. (#1750891) - -* Thu Apr 02 2020 Akira TAGOH - 2.13.92-10 -- Build against libxml2 instead of expat. - -* Sat Mar 28 2020 Nicolas Mailhot - 2.13.92-9 -- Fix DTD declaration and registration so users and Fedora automation can - easily validate new configuration files - -* Mon Mar 23 2020 Akira TAGOH - 2.13.92-8 -- Fix assertion in FcCacheFini() again. - Resolves: rhbz#1815684 - -* Wed Feb 26 2020 Akira TAGOH - 2.13.92-7 -- Fix assertion in FcCacheFini(). - -* Thu Jan 30 2020 Akira TAGOH - 2.13.92-6 -- Fix some wrong behavior with sysroot option. -- Fix reading the outdated caches. -- Apply a patch to make it MT-safe more. - -* Tue Jan 28 2020 Fedora Release Engineering - 2.13.92-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Mon Jan 20 2020 Akira TAGOH - 2.13.92-4 -- Drop font(:lang=...) from %%{=pkgkit} format. - Reference: rhbz#1792463 - -* Wed Aug 28 2019 Akira TAGOH - 2.13.92-3 -- Do not return false on FcConfigParseAndLoad*() if complain is set to false. - Resolves: rhbz#1744377 - -* Fri Aug 9 2019 Akira TAGOH - 2.13.92-2 -- Fix to affect fonthashint property for score on match. - -* Fri Aug 9 2019 Akira TAGOH - 2.13.92-1 -- New upstream release. - -* Wed Jul 31 2019 Akira TAGOH - 2.13.91-4 -- Fix make check fails. - -* Thu Jul 25 2019 Fedora Release Engineering - 2.13.91-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Sun Jun 16 2019 Tim Landscheidt - 2.13.91-2 -- Remove calls to ldconfig from scriptlets -- Use "PreReq" instead of "Requires(pre)" for freetype - -* Mon Jun 10 2019 Akira TAGOH - 2.13.91-1 -- New upstream release. - -* Fri Feb 22 2019 Akira TAGOH - 2.13.1-6 -- Update freetype version for runtime dependency to ensure - they have FT_Done_MM_Var symbol certainly. (#1679619) - -* Thu Jan 31 2019 Fedora Release Engineering - 2.13.1-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Tue Nov 13 2018 Akira TAGOH - 2.13.1-4 -- Use Rachana instead of Meera for serif subsitution. (#1649184) - -* Wed Nov 07 2018 Akira TAGOH - 2.13.1-3 -- Stop cleaning up .uuid file even when a directory is empty. - -* Wed Sep 26 2018 Akira TAGOH - 2.13.1-2 -- Add man page for fc-cache-* links to fc-cache. -- Drop unnecessary BR. - -* Thu Aug 30 2018 Akira TAGOH - 2.13.1-1 -- New upstream release. - -* Fri Jul 13 2018 Fedora Release Engineering - 2.13.0-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Fri Jun 29 2018 Akira TAGOH - 2.13.0-7 -- Use ldconfig rpm macro. - -* Thu Jun 07 2018 Akira TAGOH - 2.13.0-6 -- Add Suggests: dejavu-sans-fonts to address pulling the unpredicted - font package as dependency. (#1321551) - -* Wed Jun 06 2018 Akira TAGOH - 2.13.0-5 -- Update the version deps of freetype to resolve FT_Done_MM_Var symbol. (#1579464) +* Wed Oct 10 2018 Akira TAGOH - 2.13.0-5 +- Fix missing localized family names in caches issue. (#1634245) * Fri May 11 2018 Akira TAGOH - 2.13.0-4 - Fix the emboldening logic. (#1575649) diff --git a/plans/basic.fmf b/plans/basic.fmf deleted file mode 100644 index c1627f9..0000000 --- a/plans/basic.fmf +++ /dev/null @@ -1,5 +0,0 @@ -summary: Basic smoke test -discover: - how: fmf -execute: - how: tmt diff --git a/sources b/sources index 9a3bb99..6c9c723 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (fontconfig-2.17.0.tar.xz) = dd64905c3e0e5c5881df505b8f0bea594bbac5ce145f57aedcd7130978cd285491497198d8f2d6ed26f7b2abb31268dc3ff97aa75ce998b8e57f2d5c75b240b4 +SHA512 (fontconfig-2.13.0.tar.bz2) = f0ad8f2542c8b1e900f5c3d213466a31dd3785da726d6eb455b6734c71c6e5751b28172203e2f9668e9c8e1512072235ea46a1a5e6a85ec54ccc332adb4e5fbc diff --git a/tests/basic/main.fmf b/tests/basic/main.fmf deleted file mode 100644 index d6c06ec..0000000 --- a/tests/basic/main.fmf +++ /dev/null @@ -1,3 +0,0 @@ -summary: Concise summary describing what the test does -test: ./test.sh -framework: beakerlib diff --git a/tests/basic/test.sh b/tests/basic/test.sh deleted file mode 100755 index 10de1b4..0000000 --- a/tests/basic/test.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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