From 10c7390e358c5ad9192f35c7e5314230e75acc03 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Wed, 3 Mar 2021 21:25:06 +0900 Subject: Fix missing element for WINDOWSFONTDIR in meson also refactoring logic around it to reduce the redundant Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/276 --- fonts.conf.in | 2 +- meson.build | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/fonts.conf.in b/fonts.conf.in index 734e722..c0a63b4 100644 --- a/fonts.conf.in +++ b/fonts.conf.in @@ -24,7 +24,7 @@ - @FC_DEFAULT_FONTS@ +@FC_DEFAULT_FONTS@ @FC_FONTPATH@ fonts diff --git a/meson.build b/meson.build index dac1761..4f84ca5 100644 --- a/meson.build +++ b/meson.build @@ -204,22 +204,30 @@ prefix = get_option('prefix') fonts_conf = configuration_data() if host_machine.system() == 'windows' - conf.set_quoted('FC_DEFAULT_FONTS', 'WINDOWSFONTDIR') - fonts_conf.set('FC_DEFAULT_FONTS', 'WINDOWSFONTDIR') + fc_fonts_path = ['WINDOWSFONTDIR'] fc_cachedir = 'LOCAL_APPDATA_FONTCONFIG_CACHE' else if host_machine.system() == 'darwin' - conf.set_quoted('FC_DEFAULT_FONTS', '/System/Library/Fonts /Library/Fonts ~/Library/Fonts /System/Library/Assets/com_apple_MobileAsset_Font3 /System/Library/Assets/com_apple_MobileAsset_Font4') - fonts_conf.set('FC_DEFAULT_FONTS', '/System/Library/Fonts /Library/Fonts ~/Library/Fonts /System/Library/Assets/com_apple_MobileAsset_Font3 /System/Library/Assets/com_apple_MobileAsset_Font4') + fc_fonts_path = ['/System/Library/Fonts', '/Library/Fonts', '~/Library/Fonts', '/System/Library/Assets/com_apple_MobileAsset_Font3', '/System/Library/Assets/com_apple_MobileAsset_Font4'] else - conf.set_quoted('FC_DEFAULT_FONTS', '/usr/share/fonts') - fonts_conf.set('FC_DEFAULT_FONTS', '/usr/share/fonts') + fc_fonts_path = ['/usr/share/fonts', '/usr/local/share/fonts'] endif fc_cachedir = join_paths(prefix, get_option('localstatedir'), 'cache', meson.project_name()) thread_dep = dependency('threads') conf.set('HAVE_PTHREAD', 1) deps += [thread_dep] endif +xml_path = '' +escaped_xml_path = '' +foreach p : fc_fonts_path + s = '\t' + p + '\n' + xml_path += s + # No substitution method for string + s = '\\t' + p + '\\n' + escaped_xml_path += s +endforeach +conf.set_quoted('FC_DEFAULT_FONTS', escaped_xml_path) +fonts_conf.set('FC_DEFAULT_FONTS', xml_path) fc_templatedir = join_paths(prefix, get_option('datadir'), 'fontconfig/conf.avail') fc_baseconfigdir = join_paths(prefix, get_option('sysconfdir'), 'fonts') -- cgit v1.2.3