[Fontconfig] fontconfig: Branch 'main' - 8 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jan 28 09:31:20 UTC 2022


 conf.d/48-spacing.conf |   16 ++++++++++++++++
 conf.d/Makefile.am     |    1 +
 conf.d/meson.build     |    2 ++
 configure.ac           |    2 +-
 meson.build            |   20 +++++++++-----------
 src/fcxml.c            |   10 ++++++++++
 test/Makefile.am       |    2 +-
 7 files changed, 40 insertions(+), 13 deletions(-)

New commits:
commit 8a150f634f093a9594482b99bd3433959c8cacaa
Author: Akira TAGOH <akira at tagoh.org>
Date:   Fri Jan 28 18:13:21 2022 +0900

    Add test/wrapper-script.sh to the archive
    
    Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/307

diff --git a/test/Makefile.am b/test/Makefile.am
index d07654b..03f7324 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -174,7 +174,7 @@ check_PROGRAMS += test-family-matching
 test_family_matching_LDADD = $(top_builddir)/src/libfontconfig.la
 TESTS += test-family-matching
 
-EXTRA_DIST=run-test.sh run-test-conf.sh $(LOG_COMPILER) $(TESTDATA) out.expected-long-family-names out.expected-no-long-family-names
+EXTRA_DIST=run-test.sh run-test-conf.sh wrapper-script.sh $(TESTDATA) out.expected-long-family-names out.expected-no-long-family-names
 
 CLEANFILES =		\
 	fonts.conf	\
commit 55eb1ef89bc6f25f2ea6a9695edb93c12e368686
Author: Akira TAGOH <akira at tagoh.org>
Date:   Mon Jan 17 16:19:22 2022 +0900

    Add an user font directory for Win32 to the default font path
    
    Patch from @takase1121
    
    Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/144

diff --git a/configure.ac b/configure.ac
index d7505d8..433db7b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -486,7 +486,7 @@ AC_ARG_WITH(default-fonts,
 case "$default_fonts" in
 yes)
 	if test "$os_win32" = "yes"; then
-		default_fonts="WINDOWSFONTDIR"
+		default_fonts="WINDOWSFONTDIR,WINDOWSUSERFONTDIR"
 	elif test "$os_darwin" = "yes"; then
 		default_fonts="/System/Library/Fonts,/Library/Fonts,~/Library/Fonts,/System/Library/Assets/com_apple_MobileAsset_Font3,/System/Library/Assets/com_apple_MobileAsset_Font4"
 	else
diff --git a/meson.build b/meson.build
index 7376784..89be258 100644
--- a/meson.build
+++ b/meson.build
@@ -208,7 +208,7 @@ prefix = get_option('prefix')
 fonts_conf = configuration_data()
 
 if host_machine.system() == 'windows'
-  fc_fonts_path = ['WINDOWSFONTDIR']
+  fc_fonts_path = ['WINDOWSFONTDIR', 'WINDOWSUSERFONTDIR']
   fc_cachedir = 'LOCAL_APPDATA_FONTCONFIG_CACHE'
 else
   if host_machine.system() == 'darwin'
diff --git a/src/fcxml.c b/src/fcxml.c
index 1ee03cf..6b0f613 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -1370,6 +1370,16 @@ _get_real_paths_from_prefix(FcConfigParse *parse, const FcChar8 *path, const FcC
 	if (p) *p = '\0';
 	strcat ((char *) path, "\\..\\share\\fonts");
     }
+    else if (strcmp ((const char *) path, "WINDOWSUSERFONTDIR") == 0)
+    {
+        path = buffer;
+        if (!(pSHGetFolderPathA && SUCCEEDED(pSHGetFolderPathA(NULL, /* CSIDL_LOCAL_APPDATA */ 28, NULL, 0, (char *) buffer))))
+        {
+            FcConfigMessage(parse, FcSevereError, "SHGetFolderPathA failed");
+            return NULL;
+        }
+        strcat((char *) path, "\\Microsoft\\Windows\\Fonts");
+    }
     else if (strcmp ((const char *) path, "WINDOWSFONTDIR") == 0)
     {
 	int rc;
commit 9a6ad6f1c5f4c6024370b0b54aaa4b74ecced62c
Author: Pierre Ducroquet <pinaraf at pinaraf.info>
Date:   Wed Aug 25 10:43:20 2021 +0200

    Always add the family name from spacing=100

diff --git a/conf.d/48-spacing.conf b/conf.d/48-spacing.conf
index 9551b77..6df5c11 100644
--- a/conf.d/48-spacing.conf
+++ b/conf.d/48-spacing.conf
@@ -1,24 +1,15 @@
 <?xml version="1.0"?>
 <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
 <fontconfig>
-  <description>Add mono to the family when no generic name and spacing is 100</description>
+  <description>Add mono to the family when spacing is 100</description>
 <!--
-  If the font has no generic name and spacing 100, add mono
+  If the request specifies spacing 100, add monospace to family
  -->
 	<match target="pattern">
-		<test qual="all" name="family" compare="not_eq">
-			<string>sans-serif</string>
-		</test>
-		<test qual="all" name="family" compare="not_eq">
-			<string>serif</string>
-		</test>
-		<test qual="all" name="family" compare="not_eq">
-			<string>monospace</string>
-		</test>
 		<test qual="any" name="spacing" compare="eq">
 			<int>100</int>
 		</test>
-		<edit name="family" mode="append_last">
+		<edit name="family" mode="prepend">
 			<string>monospace</string>
 		</edit>
 	</match>
commit 686739af91b2f49c34e8f12d733d01e59f05cec3
Author: Pierre Ducroquet <pinaraf at pinaraf.info>
Date:   Mon Aug 23 15:00:52 2021 +0200

    It seems this qual doesn't work on integers

diff --git a/conf.d/48-spacing.conf b/conf.d/48-spacing.conf
index 95f394d..9551b77 100644
--- a/conf.d/48-spacing.conf
+++ b/conf.d/48-spacing.conf
@@ -15,7 +15,7 @@
 		<test qual="all" name="family" compare="not_eq">
 			<string>monospace</string>
 		</test>
-		<test qual="all" name="spacing" compare="eq">
+		<test qual="any" name="spacing" compare="eq">
 			<int>100</int>
 		</test>
 		<edit name="family" mode="append_last">
commit a2687b91d7396f246e59be55f8a0fe3411a67301
Author: Pierre Ducroquet <pinaraf at pinaraf.info>
Date:   Sat Aug 21 17:31:40 2021 +0200

    Remove configuration file from POTFILES
    
    This failed the CI for reasons unknown to me, and I don't see
    the point in translating these files.

diff --git a/po-conf/POTFILES.in b/po-conf/POTFILES.in
index 204216f..f4846ac 100644
--- a/po-conf/POTFILES.in
+++ b/po-conf/POTFILES.in
@@ -19,7 +19,6 @@ conf.d/30-metric-aliases.conf
 conf.d/40-nonlatin.conf
 conf.d/45-generic.conf
 conf.d/45-latin.conf
-conf.d/48-spacing.conf
 conf.d/49-sansserif.conf
 conf.d/50-user.conf
 conf.d/51-local.conf
commit f084aca5cfcaa9157bc910c629cdc848c036ecf2
Author: Pierre Ducroquet <pinaraf at pinaraf.info>
Date:   Sat Aug 21 16:03:28 2021 +0200

    Reference the new configuration file

diff --git a/conf.d/Makefile.am b/conf.d/Makefile.am
index 43b6e2b..502ac87 100644
--- a/conf.d/Makefile.am
+++ b/conf.d/Makefile.am
@@ -38,6 +38,7 @@ CONF_LINKS = \
 	40-nonlatin.conf \
 	45-generic.conf \
 	45-latin.conf \
+	48-spacing.conf \
 	49-sansserif.conf \
 	50-user.conf \
 	51-local.conf \
diff --git a/conf.d/meson.build b/conf.d/meson.build
index 172e2af..db99b37 100644
--- a/conf.d/meson.build
+++ b/conf.d/meson.build
@@ -22,6 +22,7 @@ conf_files = [
   '40-nonlatin.conf',
   '45-generic.conf',
   '45-latin.conf',
+  '48-spacing.conf',
   '49-sansserif.conf',
   '50-user.conf',
   '51-local.conf',
@@ -48,6 +49,7 @@ conf_links = [
   '40-nonlatin.conf',
   '45-generic.conf',
   '45-latin.conf',
+  '48-spacing.conf',
   '49-sansserif.conf',
   '50-user.conf',
   '51-local.conf',
diff --git a/po-conf/POTFILES.in b/po-conf/POTFILES.in
index f4846ac..204216f 100644
--- a/po-conf/POTFILES.in
+++ b/po-conf/POTFILES.in
@@ -19,6 +19,7 @@ conf.d/30-metric-aliases.conf
 conf.d/40-nonlatin.conf
 conf.d/45-generic.conf
 conf.d/45-latin.conf
+conf.d/48-spacing.conf
 conf.d/49-sansserif.conf
 conf.d/50-user.conf
 conf.d/51-local.conf
commit 3fcdd60a1ddadbac4b7471ada48ea073411555bb
Author: Pierre Ducroquet <pinaraf at pinaraf.info>
Date:   Sat Aug 21 15:45:50 2021 +0200

    Add a configuration to switch to monospace if spacing=100 is requested
    
    Previously, requesting a monospace font with an invalid font family
    (for instance, when a font is not embedded in a PDF, poppler may
    issue such queries), the font family would be filled by configuration
    file 49-sansserrif.conf with sans-serif
    This new rule set the family to monospace if spacing=100 is specified
    in the query.

diff --git a/conf.d/48-spacing.conf b/conf.d/48-spacing.conf
new file mode 100644
index 0000000..95f394d
--- /dev/null
+++ b/conf.d/48-spacing.conf
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
+<fontconfig>
+  <description>Add mono to the family when no generic name and spacing is 100</description>
+<!--
+  If the font has no generic name and spacing 100, add mono
+ -->
+	<match target="pattern">
+		<test qual="all" name="family" compare="not_eq">
+			<string>sans-serif</string>
+		</test>
+		<test qual="all" name="family" compare="not_eq">
+			<string>serif</string>
+		</test>
+		<test qual="all" name="family" compare="not_eq">
+			<string>monospace</string>
+		</test>
+		<test qual="all" name="spacing" compare="eq">
+			<int>100</int>
+		</test>
+		<edit name="family" mode="append_last">
+			<string>monospace</string>
+		</edit>
+	</match>
+</fontconfig>
commit 7b09c81dab9b53068abb5f546fe3b143916bf847
Author: Nirbheek Chauhan <nirbheek at centricular.com>
Date:   Sun Jan 9 17:04:25 2022 +0530

    meson: Remove summary() from version_compare() block
    
    The version_compare() block is redundant because we require meson 0.56
    now, and it fixes a spurious warning:
    
    ```
    fontconfig| WARNING: Project targeting '>= 0.53' but tried to use feature introduced in '0.54.0': list_sep arg in summary.
    ```

diff --git a/meson.build b/meson.build
index 64cae44..7376784 100644
--- a/meson.build
+++ b/meson.build
@@ -381,13 +381,11 @@ fc_headers = [
 install_headers(fc_headers, subdir: meson.project_name())
 
 # Summary
-if meson.version().version_compare('>= 0.53')
-  doc_targets = get_variable('doc_targets', [])
-
-  summary({
-         'Documentation': (doc_targets.length() > 0 ? doc_targets : false),
-         'NLS': not get_option('nls').disabled(),
-         'Tests': not get_option('tests').disabled(),
-         'Tools': not get_option('tools').disabled(),
-         }, section: 'General', bool_yn: true, list_sep: ', ')
-endif
+doc_targets = get_variable('doc_targets', [])
+
+summary({
+       'Documentation': (doc_targets.length() > 0 ? doc_targets : false),
+       'NLS': not get_option('nls').disabled(),
+       'Tests': not get_option('tests').disabled(),
+       'Tools': not get_option('tools').disabled(),
+       }, section: 'General', bool_yn: true, list_sep: ', ')


More information about the Fontconfig mailing list