diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-10-22 17:19:10 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-10-22 17:19:10 +0000 |
| commit | b3ec9c94c752d13f1cfeb6bea51c9e5e43fc6eec (patch) | |
| tree | 008ad9c97a1ee764c4a43ca1347b9d704b948a05 /src/inkscape.cpp | |
| parent | Added some improvements discused in MR (diff) | |
| parent | Preferences: cleanup (diff) | |
| download | inkscape-b3ec9c94c752d13f1cfeb6bea51c9e5e43fc6eec.tar.gz inkscape-b3ec9c94c752d13f1cfeb6bea51c9e5e43fc6eec.zip | |
Merge branch 'master' into SymbolsSearch
Diffstat (limited to 'src/inkscape.cpp')
| -rw-r--r-- | src/inkscape.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/inkscape.cpp b/src/inkscape.cpp index c6c43272c..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> @@ -47,6 +48,7 @@ #include "inkscape.h" #include "io/sys.h" #include "io/resource.h" +#include "libnrtype/FontFactory.h" #include "message-stack.h" #include "path-prefix.h" #include "resource-manager.h" @@ -429,6 +431,7 @@ Application::Application(const char* argv, bool use_gui) : _trackalt(FALSE), _use_gui(use_gui) { + using namespace Inkscape::IO::Resource; /* fixme: load application defaults */ segv_handler = signal (SIGSEGV, Application::crash_handler); @@ -499,6 +502,22 @@ Application::Application(const char* argv, bool use_gui) : Inkscape::Extension::init(); autosave_init(); + + /* Initialize font factory */ + font_factory *factory = font_factory::Default(); + if (prefs->getBool("/options/font/use_fontsdir_system", true)) { + char const *fontsdir = get_path(SYSTEM, FONTS); + factory->AddFontsDir(fontsdir); + } + if (prefs->getBool("/options/font/use_fontsdir_user", true)) { + 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() |
