diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2017-10-21 16:25:18 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2017-10-21 16:25:18 +0000 |
| commit | 2dc0f89864fded681d8ece1d077d6ff5c77bbe97 (patch) | |
| tree | 694c3b8bbc18b8fe348a97c76e20cb10f260e365 /src/inkscape.cpp | |
| parent | Add preferences widget 'PrefMultiEntry' (diff) | |
| download | inkscape-2dc0f89864fded681d8ece1d077d6ff5c77bbe97.tar.gz inkscape-2dc0f89864fded681d8ece1d077d6ff5c77bbe97.zip | |
Add preference to load additional fonts from custom directories
'custom_fontdirs' is a list of paths to search for fonts
Diffstat (limited to 'src/inkscape.cpp')
| -rw-r--r-- | src/inkscape.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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 <map> #include <glibmm/fileutils.h> +#include <glibmm/regex.h> #include <gtkmm/cssprovider.h> #include <gtkmm/icontheme.h> @@ -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<Glib::ustring> fontdirs = Glib::Regex::split_simple("\\|", fontdirs_pref); + for (auto &fontdir : fontdirs) { + factory->AddFontsDir(fontdir.c_str()); + } } Application::~Application() |
