flatpak-run: don't fail if there are no system fonts

In a minimal environment (like the one where we run installed-tests
in Debian), we might not have /usr/share/fonts.

Signed-off-by: Simon McVittie <smcv@debian.org>
tingping/wmclass
Simon McVittie 2016-06-03 18:28:35 +01:00
parent 1bf2998352
commit 9b7c339ca6
1 changed files with 6 additions and 3 deletions

View File

@ -2278,9 +2278,12 @@ add_font_path_args (GPtrArray *argv_array)
g_autoptr(GFile) user_font1 = NULL;
g_autoptr(GFile) user_font2 = NULL;
add_args (argv_array,
"--bind", SYSTEM_FONTS_DIR, "/run/host/fonts",
NULL);
if (g_file_test (SYSTEM_FONTS_DIR, G_FILE_TEST_EXISTS))
{
add_args (argv_array,
"--bind", SYSTEM_FONTS_DIR, "/run/host/fonts",
NULL);
}
home = g_file_new_for_path (g_get_home_dir ());
user_font1 = g_file_resolve_relative_path (home, ".local/share/fonts");