diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2017-10-16 09:39:26 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2017-10-16 09:39:26 +0000 |
| commit | 5c009e15be8446c010a4103a9626653c7819274a (patch) | |
| tree | fdd71bdcb8c0d6b12748ed372431c125f9ffb638 /src | |
| parent | Fix link for FAQ entry on DPI change (diff) | |
| download | inkscape-5c009e15be8446c010a4103a9626653c7819274a.tar.gz inkscape-5c009e15be8446c010a4103a9626653c7819274a.zip | |
Update properties for SVG 2 text. Partial work from Alex Roman
Diffstat (limited to 'src')
| -rw-r--r-- | src/attributes.cpp | 3 | ||||
| -rw-r--r-- | src/attributes.h | 3 | ||||
| -rw-r--r-- | src/style.cpp | 32 | ||||
| -rw-r--r-- | src/style.h | 5 |
4 files changed, 36 insertions, 7 deletions
diff --git a/src/attributes.cpp b/src/attributes.cpp index 9ba646ab4..6522563af 100644 --- a/src/attributes.cpp +++ b/src/attributes.cpp @@ -507,9 +507,10 @@ static SPStyleProp const props[] = { /* SVG 2 Text Wrapping */ {SP_PROP_SHAPE_INSIDE, "shape-inside"}, - {SP_PROP_SHAPE_OUTSIDE, "shape-outside"}, + {SP_PROP_SHAPE_SUBTRACT,"shape-subtract"}, {SP_PROP_SHAPE_PADDING, "shape-padding"}, {SP_PROP_SHAPE_MARGIN, "shape-margin"}, + {SP_PROP_INLINE_SIZE, "inline-size"}, /* Text Decoration */ {SP_PROP_TEXT_DECORATION, "text-decoration"}, // CSS 2/CSS3-Shorthand diff --git a/src/attributes.h b/src/attributes.h index 3fee14133..a2c1c30f5 100644 --- a/src/attributes.h +++ b/src/attributes.h @@ -515,9 +515,10 @@ enum SPAttributeEnum { /* SVG 2 Text Wrapping */ SP_PROP_SHAPE_INSIDE, - SP_PROP_SHAPE_OUTSIDE, + SP_PROP_SHAPE_SUBTRACT, SP_PROP_SHAPE_PADDING, SP_PROP_SHAPE_MARGIN, + SP_PROP_INLINE_SIZE, /* Text Decoration */ SP_PROP_TEXT_DECORATION, // CSS 2/CSS3-Shorthand diff --git a/src/style.cpp b/src/style.cpp index d5bbcd9ce..608cca1e6 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -134,9 +134,10 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) : // SVG 2 Text Wrapping shape_inside( "shape-inside" ), // SPIString - //shape_outside( "shape-outside" ), // SPIString + shape_subtract( "shape-subtract" ), // SPIString shape_padding( "shape-padding", 0.0 ), // SPILength for now - //shape_margin( "shape-margin", 0.0 ), // SPILength for now + shape_margin( "shape-margin", 0.0 ), // SPILength for now + inline_size( "inline-size", 0.0 ), // SPILength for now text_decoration(), text_decoration_line(), @@ -252,6 +253,8 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) : stroke_width.setStylePointer( this ); stroke_dashoffset.setStylePointer( this ); shape_padding.setStylePointer( this ); + shape_margin.setStylePointer( this ); + inline_size.setStylePointer( this ); // Properties that depend on 'color' text_decoration_color.setStylePointer( this ); @@ -323,7 +326,10 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) : _properties.push_back( &white_space ); _properties.push_back( &shape_inside ); + _properties.push_back( &shape_subtract ); _properties.push_back( &shape_padding ); + _properties.push_back( &shape_margin ); + _properties.push_back( &inline_size ); _properties.push_back( &clip_rule ); _properties.push_back( &display ); @@ -799,9 +805,18 @@ SPStyle::readIfUnset( gint id, gchar const *val, SPStyleSrc const &source ) { case SP_PROP_SHAPE_INSIDE: shape_inside.readIfUnset( val, source ); break; + case SP_PROP_SHAPE_SUBTRACT: + shape_subtract.readIfUnset( val, source ); + break; case SP_PROP_SHAPE_PADDING: shape_padding.readIfUnset( val, source ); break; + case SP_PROP_SHAPE_MARGIN: + shape_margin.readIfUnset( val, source ); + break; + case SP_PROP_INLINE_SIZE: + inline_size.readIfUnset( val, source ); + break; case SP_PROP_DOMINANT_BASELINE: dominant_baseline.readIfUnset( val, source ); break; @@ -1153,7 +1168,6 @@ SPStyle::_mergeDecl( CRDeclaration const *const decl, SPStyleSrc const &source * convert to string. Alternatively, set from CRTerm directly rather * than converting to string. */ - guchar *const str_value_unsigned = cr_term_to_string(decl->value); gchar *const str_value = reinterpret_cast<gchar *>(str_value_unsigned); @@ -1720,9 +1734,18 @@ sp_style_unset_property_attrs(SPObject *o) if (style->shape_inside.set) { repr->setAttribute("shape-inside", NULL); } + if (style->shape_subtract.set) { + repr->setAttribute("shape-subtract", NULL); + } if (style->shape_padding.set) { repr->setAttribute("shape-padding", NULL); } + if (style->shape_margin.set) { + repr->setAttribute("shape-margin", NULL); + } + if (style->inline_size.set) { + repr->setAttribute("inline-size", NULL); + } if (style->writing_mode.set) { repr->setAttribute("writing-mode", NULL); } @@ -1815,7 +1838,10 @@ sp_css_attr_unset_text(SPCSSAttr *css) sp_repr_css_set_property(css, "text-anchor", NULL); sp_repr_css_set_property(css, "white-space", NULL); sp_repr_css_set_property(css, "shape-inside", NULL); + sp_repr_css_set_property(css, "shape-subtract", NULL); sp_repr_css_set_property(css, "shape-padding", NULL); + sp_repr_css_set_property(css, "shape-margin", NULL); + sp_repr_css_set_property(css, "inline-size", NULL); sp_repr_css_set_property(css, "kerning", NULL); // not implemented yet sp_repr_css_set_property(css, "dominant-baseline", NULL); // not implemented yet sp_repr_css_set_property(css, "alignment-baseline", NULL); // not implemented yet diff --git a/src/style.h b/src/style.h index 85d07b9ef..1b6ee2f47 100644 --- a/src/style.h +++ b/src/style.h @@ -166,9 +166,10 @@ public: /** SVG2 Text Wrapping */ SPIString shape_inside; - // SPIString shape_outside; + SPIString shape_subtract; SPILength shape_padding; - // SPILength shape_margin; + SPILength shape_margin; + SPILength inline_size; /* Text Decoration ----------------------- */ |
