diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-09-09 21:15:05 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-09-09 21:15:05 +0000 |
| commit | bff5da8f40ab650dafa8f8a2b24a0a8d386df98c (patch) | |
| tree | 99f3aa3d60390f09148e33d3a235e51b37291b5a /src/ui/dialog/text-edit.cpp | |
| parent | Update .po files (diff) | |
| download | inkscape-bff5da8f40ab650dafa8f8a2b24a0a8d386df98c.tar.gz inkscape-bff5da8f40ab650dafa8f8a2b24a0a8d386df98c.zip | |
Load GPOS table only when selecting font features tab to speedup font usage
Diffstat (limited to 'src/ui/dialog/text-edit.cpp')
| -rw-r--r-- | src/ui/dialog/text-edit.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ui/dialog/text-edit.cpp b/src/ui/dialog/text-edit.cpp index e0faa68ed..4550d8ade 100644 --- a/src/ui/dialog/text-edit.cpp +++ b/src/ui/dialog/text-edit.cpp @@ -41,6 +41,7 @@ extern "C" { #include "text-editing.h" #include "verbs.h" +#include <libnrtype/FontFactory.h> #include <libnrtype/font-instance.h> #include <libnrtype/font-lister.h> @@ -160,7 +161,7 @@ TextEdit::TextEdit() close_button.signal_clicked().connect(sigc::bind(_signal_response.make_slot(), GTK_RESPONSE_CLOSE)); fontChangedConn = font_selector.connectChanged (sigc::mem_fun(*this, &TextEdit::onFontChange)); fontFeaturesChangedConn = font_features.connectChanged(sigc::mem_fun(*this, &TextEdit::onChange)); - + notebook.signal_switch_page().connect(sigc::mem_fun(*this, &TextEdit::onFontFeatures)); desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &TextEdit::setTargetDesktop) ); deskTrack.connect(GTK_WIDGET(gobj())); @@ -475,6 +476,20 @@ void TextEdit::onApply() blocked = false; } +void TextEdit::onFontFeatures(Gtk::Widget * widgt, int pos) +{ + if (pos == 1) { + Glib::ustring fontspec = font_selector.get_fontspec(); + if (!fontspec.empty()) { + font_instance *res = font_factory::Default()->FaceFromFontSpecification(fontspec.c_str()); + if (res && !res->fulloaded) { + res->InitTheFace(true); + font_features.update_opentype(fontspec); + } + } + } +} + void TextEdit::onChange() { if (blocked) { |
