diff options
| author | jabiertxof <jabiertxof@debian.marker.es> | 2015-04-29 14:33:09 +0000 |
|---|---|---|
| committer | jabiertxof <jabiertxof@debian.marker.es> | 2015-04-29 14:33:09 +0000 |
| commit | cd2a40d327c536e12dd113a0c8c2fe5038affe48 (patch) | |
| tree | 7e8c12e63848a90246f591067244f6891fd70336 /src/path-chemistry.cpp | |
| parent | Fis fix a bug finded in my presentation in the HackFest (diff) | |
| parent | Increase precision (long thin paths had a ton of width variance), fix logic e... (diff) | |
| download | inkscape-cd2a40d327c536e12dd113a0c8c2fe5038affe48.tar.gz inkscape-cd2a40d327c536e12dd113a0c8c2fe5038affe48.zip | |
update to trunk
(bzr r12588.1.44)
Diffstat (limited to 'src/path-chemistry.cpp')
| -rw-r--r-- | src/path-chemistry.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 5f6e1495b..988559e30 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -362,7 +362,7 @@ bool sp_item_list_to_curves(const GSList *items, GSList **selected, GSList **to_select, bool skip_all_lpeitems) { bool did = false; - + for (; items != NULL; items = items->next) { @@ -488,6 +488,9 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 /*text_grouping_policy*/) if (dynamic_cast<SPText *>(item) || dynamic_cast<SPFlowtext *>(item)) { // Special treatment for text: convert each glyph to separate path, then group the paths Inkscape::XML::Node *g_repr = xml_doc->createElement("svg:g"); + + Glib::ustring original_text; // To save original text of accessibility. + g_repr->setAttribute("transform", item->getRepr()->attribute("transform")); /* Mask */ gchar *mask_str = (gchar *) item->getRepr()->attribute("mask"); @@ -508,6 +511,8 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 /*text_grouping_policy*/) Inkscape::Text::Layout::iterator iter = te_get_layout(item)->begin(); do { + original_text += (gunichar)te_get_layout(item)->characterAt( iter ); + Inkscape::Text::Layout::iterator iter_next = iter; iter_next.nextGlyph(); // iter_next is one glyph ahead from iter if (iter == iter_next) @@ -547,6 +552,11 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 /*text_grouping_policy*/) p_repr->setAttribute("style", style_str.c_str()); g_repr->appendChild(p_repr); + + // For accessibility, store original string + if( original_text.size() > 0 ) { + g_repr->setAttribute("aria-label", original_text.c_str() ); + } Inkscape::GC::release(p_repr); if (iter == te_get_layout(item)->end()) |
