diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2017-10-20 20:59:35 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2017-10-20 21:24:09 +0000 |
| commit | 75444920325ba8a134eb16c4844f7fa15f34dd55 (patch) | |
| tree | cf649a444ee98c3949f27bd68755a8f834e025a3 /src/inkscape.cpp | |
| parent | Define INKSCAPE_FONTSDIR and add USER/SYSTEM resource paths for fonts (diff) | |
| download | inkscape-75444920325ba8a134eb16c4844f7fa15f34dd55.tar.gz inkscape-75444920325ba8a134eb16c4844f7fa15f34dd55.zip | |
Add preference to load additional fonts from 'fonts' directories
- 'use_fontsdir_system' for /share/inkscape/fonts
- 'use_fontsdir_user' for /inkscape/fonts in user config
(both activated by default)
Diffstat (limited to 'src/inkscape.cpp')
| -rw-r--r-- | src/inkscape.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/inkscape.cpp b/src/inkscape.cpp index c6c43272c..0c3763c2b 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -47,6 +47,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 +430,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 +501,17 @@ 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); + } } Application::~Application() |
