diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2018-04-03 12:31:45 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2018-04-03 12:31:45 +0000 |
| commit | 3003ccd72ce708cd97b7f06abbd235589afa8cfe (patch) | |
| tree | 2fbfe48e99bd153789282d703db29ab91b94294d | |
| parent | Fix crash when selection non-variation style. (diff) | |
| download | inkscape-3003ccd72ce708cd97b7f06abbd235589afa8cfe.tar.gz inkscape-3003ccd72ce708cd97b7f06abbd235589afa8cfe.zip | |
Unset 'font-variation-settings' if not used.
| -rw-r--r-- | src/libnrtype/font-lister.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libnrtype/font-lister.cpp b/src/libnrtype/font-lister.cpp index e363ac7f8..3c4e159fd 100644 --- a/src/libnrtype/font-lister.cpp +++ b/src/libnrtype/font-lister.cpp @@ -766,9 +766,9 @@ void FontLister::fill_css(SPCSSAttr *css, Glib::ustring fontspec) // Convert Pango variations string to CSS format const char* str = pango_font_description_get_variations(desc); - if (str) { + std::string variations; - std::string variations; + if (str) { std::vector<Glib::ustring> tokens = Glib::Regex::split_simple(",", str); @@ -788,7 +788,12 @@ void FontLister::fill_css(SPCSSAttr *css, Glib::ustring fontspec) variations.pop_back(); variations.pop_back(); } + } + + if (!variations.empty()) { sp_repr_css_set_property(css, "font-variation-settings", variations.c_str()); + } else { + sp_repr_css_unset_property(css, "font-variation-settings" ); } #endif } |
