diff options
| author | su_v <suv-sf@users.sourceforge.net> | 2014-06-15 09:08:03 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2014-06-15 09:08:03 +0000 |
| commit | ccacefacda584c206625b7759001d3d8c531cfed (patch) | |
| tree | 8c00cc50f5bb400b62639c06c234d11fa982502b /src/style-internal.cpp | |
| parent | update to trunk (r13407) (diff) | |
| parent | Allow symbol zooming independent of icon screen size. (diff) | |
| download | inkscape-ccacefacda584c206625b7759001d3d8c531cfed.tar.gz inkscape-ccacefacda584c206625b7759001d3d8c531cfed.zip | |
update to trunk (r13425)
(bzr r13398.1.3)
Diffstat (limited to 'src/style-internal.cpp')
| -rw-r--r-- | src/style-internal.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/style-internal.cpp b/src/style-internal.cpp index 8b4f3c1cd..c686a1807 100644 --- a/src/style-internal.cpp +++ b/src/style-internal.cpp @@ -656,20 +656,21 @@ SPIString::read( gchar const *str ) { set = true; inherit = false; - // libcroco puts quotes around some strings... remove - Glib::ustring str_unquoted(str); - css_unquote( str_unquoted ); - - // Unquote individual family names, Pango always uses unquoted names. + Glib::ustring str_temp(str); if( name.compare( "font-family" ) == 0 ) { - css_font_family_unquote( str_unquoted ); + // Family names may be quoted in CSS, internally we use unquoted names. + css_font_family_unquote( str_temp ); + } else if( name.compare( "-inkscape-font-specification" ) == 0 ) { + css_unquote( str_temp ); } - value = g_strdup(str_unquoted.c_str()); + value = g_strdup(str_temp.c_str()); } } +// This routine is actually rarely used. Writing is done usually +// in sp_repr_css_write_string... const Glib::ustring SPIString::write( guint const flags, SPIBase const *const base) const { @@ -684,13 +685,13 @@ SPIString::write( guint const flags, SPIBase const *const base) const { } else { if( this->value ) { if( name.compare( "font-family" ) == 0 ) { - // This is for compatibilty with the C version of code. - // This is incorrect as it puts single quotes around the - // entire string rather around the individule font names. - // This should be handled by the routines that extract - // out the font family names and reassembles them into a - // font fallback list. FIXME - return (name + ":" + css2_escape_quote(this->value) + ";"); + Glib::ustring font_family( this->value ); + css_font_family_quote( font_family ); + return (name + ":" + font_family + ";"); + } else if( name.compare( "-inkscape-font-specification" ) == 0 ) { + Glib::ustring font_spec( this->value ); + css_quote( font_spec ); + return (name + ":" + font_spec + ";"); } else { return (name + ":" + this->value + ";"); } |
