I have a patch that improves the issue. The created text now behaves much more like text created through the UI. Bugs certainly remain though.
gboolean document_interface_text (DocumentInterface *object, int x, int y, gchar *text, GError **error) {
Inkscape::XML::Node *text_node = dbus_create_node(object->desk, "svg:text"); Inkscape::XML::Node *tspan_node = NULL;
tspan_node = dbus_create_node(object->desk, "svg:tspan"); sp_repr_set_svg_double(tspan_node, "x", x); sp_repr_set_svg_double(tspan_node, "y", y);
// Add text content node to tspan SPDocument * doc = sp_desktop_document (object->desk); Inkscape::XML::Document *xml_doc = doc->getReprDoc();
Inkscape::XML::Node *text_content = xml_doc->createTextNode(text); tspan_node->appendChild(text_content); text_node->appendChild(tspan_node); // Inkscape::GC::release(text_content); finish_create_shape (object, error, text_node, (gchar *)"create text"); return TRUE; }
I have a patch that improves the issue. The created text now behaves much more like text created through the UI.
Bugs certainly remain though.
gboolean interface_ text (DocumentInterface *object, int x, int y, gchar *text, GError **error)
document_
{
Inkscape: :XML::Node *text_node = dbus_create_ node(object- >desk, "svg:text"); :XML::Node *tspan_node = NULL;
Inkscape:
tspan_node = dbus_create_ node(object- >desk, "svg:tspan"); repr_set_ svg_double( tspan_node, "x", x); repr_set_ svg_double( tspan_node, "y", y);
sp_
sp_
// Add text content node to tspan :XML::Document *xml_doc = doc->getReprDoc();
SPDocument * doc = sp_desktop_document (object->desk);
Inkscape:
Inkscape: :XML::Node *text_content = xml_doc- >createTextNode (text); node->appendChi ld(text_ content) ; node->appendChi ld(tspan_ node); :GC::release( text_content) ; create_ shape (object, error, text_node, (gchar *)"create text");
tspan_
text_
// Inkscape:
finish_
return TRUE;
}