Arabic text: changing colour changes form

Bug #872572 reported by Paul Sladen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Medium
Unassigned

Bug Description

Arabic requires advanced OpenType contextual layout: in Arabic each characters has four forms (standalone, initial, intermediate, final) depending upon its positioning with the surrounding characters.

If one (intermediate) character is selected in Inkscape and its colour is altered, then the composition is broken, and the standalone form being shown.

Ideally changing the colour of one character should not alter the glyph that is shown for that character.

Tags: fonts text
Revision history for this message
Paul Sladen (sladen) wrote :
Revision history for this message
Paul Sladen (sladen) wrote :

SVG source for above.

Revision history for this message
su_v (suv-lp) wrote :

> Ideally changing the colour of one character should
> not alter the glyph that is shown for that character.

AFAIU this is a limitation of the underlying SVG code: if changing the fill color attribute of an individual letter (or a sub-string), the differently styled character needs to be wrapped into a separate (nested) <tspan> to override the inherited style, making the individually colored character "standalone".

The same can be reproduced with any font which uses ligatures (e.g. 'Aller' or 'Lobster'):
<http://imgh.us/ligatures-ttf-inkscape-1.png>

tags: added: fonts text
Revision history for this message
su_v (suv-lp) wrote :

Setting status to 'Confirmed' for now (reproduced with Inkscape 0.48.2 and 0.48+devel r10672, on Mac OS X 10.5.8 (i386)).

Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

Related to (or duplicate of)
- Bug #332580 “Applying colour to text breaks Arabic shaping "
  <https://bugs.launchpad.net/inkscape/+bug/332580>

Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

There are two separate issues that need to be addressed:

The first is that it is not clear from the CSS and SVG specs what the correct behavior should be. What should cause stand-alone forms to be shown? Changing font size? Changing font weight? Adding letter spacing? Moving characters using the 'x' or 'dx' attributes? The latter does result according to the specs in breaking non-mandatory ligatures.

The second issue is the amount of code that would need to be rewritten. Currently Inkscape handles text one tspan at a time. As any change in color results in a new tspan, Inkscape would have to be change to handle multiple tspans together. Pango does have a function that is designed to shape text across changes in style (pango_shape_full())[1] but it would still require quite a bit of code rewriting. I am hesitant to try to make any changes until the first issue is settled.

[1] https://developer.gnome.org/pango/stable/pango-Text-Processing.html#pango-shape-full

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.