From 2dc0f89864fded681d8ece1d077d6ff5c77bbe97 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 21 Oct 2017 18:25:18 +0200 Subject: Add preference to load additional fonts from custom directories 'custom_fontdirs' is a list of paths to search for fonts --- src/inkscape.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 0c3763c2b..e7e93929b 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -512,6 +513,11 @@ Application::Application(const char* argv, bool use_gui) : char const *fontsdir = get_path(USER, FONTS); factory->AddFontsDir(fontsdir); } + Glib::ustring fontdirs_pref = prefs->getString("/options/font/custom_fontdirs"); + std::vector fontdirs = Glib::Regex::split_simple("\\|", fontdirs_pref); + for (auto &fontdir : fontdirs) { + factory->AddFontsDir(fontdir.c_str()); + } } Application::~Application() -- cgit v1.2.3