diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2015-05-14 05:24:57 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2015-05-14 05:24:57 +0000 |
| commit | ffd7534dc2d5d718dbc0720c17dda56f57fcd7ed (patch) | |
| tree | f8c1c9babeae5dab727b203dfebfcb84cc6a4832 /src/ui/widget/font-variants.cpp | |
| parent | Fix make check (diff) | |
| download | inkscape-ffd7534dc2d5d718dbc0720c17dda56f57fcd7ed.tar.gz inkscape-ffd7534dc2d5d718dbc0720c17dda56f57fcd7ed.zip | |
Enable setting of 'font-variant-ligatures' (rendering waits on new Pango library).
(bzr r14152)
Diffstat (limited to 'src/ui/widget/font-variants.cpp')
| -rw-r--r-- | src/ui/widget/font-variants.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ui/widget/font-variants.cpp b/src/ui/widget/font-variants.cpp index 46fbc2aa4..7da7662e2 100644 --- a/src/ui/widget/font-variants.cpp +++ b/src/ui/widget/font-variants.cpp @@ -27,6 +27,7 @@ #include "sp-tref.h" #include "sp-textpath.h" #include "sp-item-group.h" +#include "xml/repr.h" namespace Inkscape { namespace UI { @@ -230,6 +231,33 @@ namespace Widget { _ligatures_contextual.set_inconsistent( mix & SP_CSS_FONT_VARIANT_LIGATURES_CONTEXTUAL ); } + void + FontVariants::fill_css( SPCSSAttr *css ) { + + // Ligatures + bool common = _ligatures_common.get_active(); + bool discretionary = _ligatures_discretionary.get_active(); + bool historical = _ligatures_historical.get_active(); + bool contextual = _ligatures_contextual.get_active(); + + if( !common && !discretionary && !historical && !contextual ) { + sp_repr_css_set_property(css, "font-variant-ligatures", "none" ); + } else if ( common && !discretionary && !historical && contextual ) { + sp_repr_css_set_property(css, "font-variant-ligatures", "normal" ); + } else { + Glib::ustring css_string; + if ( !common ) + css_string += "no-common-ligatures "; + if ( discretionary ) + css_string += "discretionary-ligatures "; + if ( historical ) + css_string += "historical-ligatures "; + if ( !contextual ) + css_string += "no-contextual "; + sp_repr_css_set_property(css, "font-variant-ligatures", css_string.c_str() ); + } + } + } // namespace Widget } // namespace UI } // namespace Inkscape |
