diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2018-12-18 12:14:58 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2018-12-18 12:14:58 +0000 |
| commit | 9666f3139382451bc2a84eb9959d690f75b8250b (patch) | |
| tree | 5b1a40d4a553bf7dde87c96d290ab80a80890fb1 /src/text-chemistry.cpp | |
| parent | remove "Perspective path" LPE (diff) | |
| download | inkscape-9666f3139382451bc2a84eb9959d690f75b8250b.tar.gz inkscape-9666f3139382451bc2a84eb9959d690f75b8250b.zip | |
Add ability to create SVG 2 text:
'shape-inside' (disabled for the moment)
'inline-size' (via on-screen knot)
Diffstat (limited to 'src/text-chemistry.cpp')
| -rw-r--r-- | src/text-chemistry.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp index 268902424..61e2eff6c 100644 --- a/src/text-chemistry.cpp +++ b/src/text-chemistry.cpp @@ -299,6 +299,40 @@ text_flow_into_shape() return; } + if (false) { + // SVG 2 Text + + if (SP_IS_TEXT(text)) { + + // Make list of all shapes. + Glib::ustring shape_inside; + auto items = selection->items(); + for (auto item : items) { + if (SP_IS_SHAPE(item)) { + shape_inside += "url(#"; + shape_inside += item->getId(); + shape_inside += ") "; + } + } + + // Remove extra space at end. + if (shape_inside.length() > 1) { + shape_inside.erase (shape_inside.length() - 1); + } + + // Set 'shape-inside' property. + SPCSSAttr* css = sp_repr_css_attr (text->getRepr(), "style"); + sp_repr_css_set_property (css, "shape-inside", shape_inside.c_str()); + sp_repr_css_set (text->getRepr(), css, "style"); + } + + DocumentUndo::done(doc, SP_VERB_CONTEXT_TEXT, + _("Flow text into shape")); + + + } else { + // SVG 1.2 Flowed Text + if (SP_IS_TEXT(text)) { // remove transform from text, but recursively scale text's fontsize by the expansion SP_TEXT(text)->_adjustFontsizeRecursive(text, text->transform.descrim()); @@ -370,6 +404,8 @@ text_flow_into_shape() Inkscape::GC::release(root_repr); Inkscape::GC::release(region_repr); + + } } void |
