diff options
author | Akira TAGOH <akira@tagoh.org> | 2021-03-03 21:25:06 +0900 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2021-03-03 22:16:56 +0900 |
commit | 10c7390e358c5ad9192f35c7e5314230e75acc03 (patch) | |
tree | 94bf776b55ca77972ac5c7ae8ee27c9fdba75d34 | |
parent | 4e42925096e97f4a6c9d09f475de7eb54a226668 (diff) |
Fix missing <dir> element for WINDOWSFONTDIR in meson
also refactoring logic around it to reduce the redundant
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/276
-rw-r--r-- | fonts.conf.in | 2 | ||||
-rw-r--r-- | 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 @@ <!-- Font directory list --> - @FC_DEFAULT_FONTS@ +@FC_DEFAULT_FONTS@ @FC_FONTPATH@ <dir prefix="xdg">fonts</dir> <!-- the following element will be removed in the future --> 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', '<dir>/System/Library/Fonts</dir> <dir>/Library/Fonts</dir> <dir>~/Library/Fonts</dir> <dir>/System/Library/Assets/com_apple_MobileAsset_Font3</dir> <dir>/System/Library/Assets/com_apple_MobileAsset_Font4</dir>') - fonts_conf.set('FC_DEFAULT_FONTS', '<dir>/System/Library/Fonts</dir> <dir>/Library/Fonts</dir> <dir>~/Library/Fonts</dir> <dir>/System/Library/Assets/com_apple_MobileAsset_Font3</dir> <dir>/System/Library/Assets/com_apple_MobileAsset_Font4</dir>') + 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', '<dir>/usr/share/fonts</dir>') - fonts_conf.set('FC_DEFAULT_FONTS', '<dir>/usr/share/fonts</dir>') + 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<dir>' + p + '</dir>\n' + xml_path += s + # No substitution method for string + s = '\\t<dir>' + p + '</dir>\\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') |