summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/attributes.cpp5
-rw-r--r--src/attributes.h5
-rw-r--r--src/style.cpp27
-rw-r--r--src/style.h6
4 files changed, 43 insertions, 0 deletions
diff --git a/src/attributes.cpp b/src/attributes.cpp
index f386832c7..81b12c658 100644
--- a/src/attributes.cpp
+++ b/src/attributes.cpp
@@ -438,6 +438,11 @@ static SPStyleProp const props[] = {
{SP_PROP_KERNING, "kerning"},
{SP_PROP_TEXT_ANCHOR, "text-anchor"},
{SP_PROP_WHITE_SPACE, "white-space"},
+ /* SVG 2 Text Wrapping */
+ {SP_PROP_SHAPE_INSIDE, "shape-inside"},
+ {SP_PROP_SHAPE_OUTSIDE, "shape-outside"},
+ {SP_PROP_SHAPE_PADDING, "shape-padding"},
+ {SP_PROP_SHAPE_MARGIN, "shape-margin"},
/* Text Decoration */
{SP_PROP_TEXT_DECORATION, "text-decoration"},
{SP_PROP_TEXT_DECORATION_LINE, "text-decoration-line"},
diff --git a/src/attributes.h b/src/attributes.h
index 97540bc71..660145a54 100644
--- a/src/attributes.h
+++ b/src/attributes.h
@@ -445,6 +445,11 @@ enum SPAttributeEnum {
SP_PROP_TEXT_ANCHOR,
SP_PROP_WHITE_SPACE,
+ SP_PROP_SHAPE_INSIDE,
+ SP_PROP_SHAPE_OUTSIDE,
+ SP_PROP_SHAPE_PADDING,
+ SP_PROP_SHAPE_MARGIN,
+
/* Text Decoration */
SP_PROP_TEXT_DECORATION, /* SVG 1 underline etc.( no color or style) OR SVG2 with _LINE, _STYLE, _COLOR values */
SP_PROP_TEXT_DECORATION_LINE, /* SVG 2 underline etc. */
diff --git a/src/style.cpp b/src/style.cpp
index 0772a4bce..8b6c4c79e 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -133,6 +133,12 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) :
text_anchor( "text-anchor", enum_text_anchor, SP_CSS_TEXT_ANCHOR_START ),
white_space( "white-space", enum_white_space, SP_CSS_WHITE_SPACE_NORMAL ),
+ // SVG 2 Text Wrapping
+ shape_inside( "shape-inside" ), // SPIString
+ //shape_outside( "shape-outside" ), // SPIString
+ shape_padding( "shape-padding", 0.0 ), // SPILength for now
+ //shape_margin( "shape-margin", 0.0 ), // SPILength for now
+
text_decoration(),
text_decoration_line(),
text_decoration_style(),
@@ -300,6 +306,9 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) :
_properties.push_back( &text_anchor );
_properties.push_back( &white_space );
+ _properties.push_back( &shape_inside );
+ _properties.push_back( &shape_padding );
+
_properties.push_back( &clip_rule );
_properties.push_back( &display );
_properties.push_back( &overflow );
@@ -383,6 +392,10 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) :
// _propmap.insert( std::make_pair( text_anchor.name, reinterpret_cast<SPIBasePtr>(&SPStyle::text_anchor ) ) );
// _propmap.insert( std::make_pair( white_space.name, reinterpret_cast<SPIBasePtr>(&SPStyle::white_space ) ) );
+
+ // _propmap.insert( std::make_pair( shape_inside.name, reinterpret_cast<SPIBasePtr>(&SPStyle::shape_inside ) ) );
+ // _propmap.insert( std::make_pair( shape_padding.name, reinterpret_cast<SPIBasePtr>(&SPStyle::shape_padding ) ) );
+
// _propmap.insert( std::make_pair( clip_rule.name, reinterpret_cast<SPIBasePtr>(&SPStyle::clip_rule ) ) );
// _propmap.insert( std::make_pair( display.name, reinterpret_cast<SPIBasePtr>(&SPStyle::display ) ) );
// _propmap.insert( std::make_pair( overflow.name, reinterpret_cast<SPIBasePtr>(&SPStyle::overflow ) ) );
@@ -719,6 +732,12 @@ SPStyle::readIfUnset( gint id, gchar const *val ) {
case SP_PROP_WHITE_SPACE:
white_space.readIfUnset( val );
break;
+ case SP_PROP_SHAPE_INSIDE:
+ shape_inside.readIfUnset( val );
+ break;
+ case SP_PROP_SHAPE_PADDING:
+ shape_padding.readIfUnset( val );
+ break;
case SP_PROP_BASELINE_SHIFT:
baseline_shift.readIfUnset( val );
break;
@@ -1526,6 +1545,12 @@ sp_style_unset_property_attrs(SPObject *o)
if (style->white_space.set) {
repr->setAttribute("white_space", NULL);
}
+ if (style->shape_inside.set) {
+ repr->setAttribute("shape_inside", NULL);
+ }
+ if (style->shape_padding.set) {
+ repr->setAttribute("shape_padding", NULL);
+ }
if (style->writing_mode.set) {
repr->setAttribute("writing_mode", NULL);
}
@@ -1614,6 +1639,8 @@ sp_css_attr_unset_text(SPCSSAttr *css)
sp_repr_css_set_property(css, "writing-mode", NULL);
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-padding", 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 3f21f37db..ab34476b3 100644
--- a/src/style.h
+++ b/src/style.h
@@ -142,6 +142,12 @@ public:
/** white space (svg2) */
SPIEnum white_space;
+ /** SVG2 Text Wrapping */
+ SPIString shape_inside;
+ // SPIString shape_outside;
+ SPILength shape_padding;
+ // SPILength shape_margin;
+
/* Text Decoration ----------------------- */
/** text decoration (css2 16.3.1) */