Skip to content

Commit

Permalink
Bubblewrap launcher doesn't bind font locations from XDG_DATA_DIRS
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=237089

Patch by Liliana Marie Prikler <liliana.prikler@gmail.com> on 2022-02-23
Reviewed by Michael Catanzaro.

* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bindFonts): Expose font directories present in the
XDG_DATA_DIRS environment variable.


Canonical link: https://commits.webkit.org/247709@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Liliana Marie Prikler authored and webkit-commit-queue committed Feb 23, 2022
1 parent 0d187f4 commit 31ac354
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Source/WebKit/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
2022-02-23 Liliana Marie Prikler <liliana.prikler@gmail.com>

Bubblewrap launcher doesn't bind font locations from XDG_DATA_DIRS
https://bugs.webkit.org/show_bug.cgi?id=237089

Reviewed by Michael Catanzaro.

* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bindFonts): Expose font directories present in the
XDG_DATA_DIRS environment variable.

2022-02-23 Chris Dumez <cdumez@apple.com>

Adopt more widely the new URL constructor that takes in a String
Expand Down
5 changes: 5 additions & 0 deletions Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ static void bindFonts(Vector<CString>& args)
const char* homeDir = g_get_home_dir();
const char* dataDir = g_get_user_data_dir();
const char* cacheDir = g_get_user_cache_dir();
const char* const * dataDirs = g_get_system_data_dirs();

// Configs can include custom dirs but then we have to parse them...
GUniquePtr<char> fontConfig(g_build_filename(configDir, "fontconfig", nullptr));
Expand All @@ -304,6 +305,10 @@ static void bindFonts(Vector<CString>& args)
bindIfExists(args, fontHomeConfigDir.get());
bindIfExists(args, fontData.get());
bindIfExists(args, fontHomeData.get());
for (auto* dataDir = dataDirs; dataDir && *dataDir; dataDir++) {
GUniquePtr<char> fontDataDir(g_build_filename(*dataDir, "fonts", nullptr));
bindIfExists(args, fontDataDir.get());
}
bindIfExists(args, "/var/cache/fontconfig"); // Used by Debian.
}

Expand Down

0 comments on commit 31ac354

Please sign in to comment.