[svgwg] Text layout algorithm: An error with a character with both of 'x' and 'dx (or 'y' and 'dy') (#845)

tkent-google has just created a new issue for https://github.com/w3c/svgwg:

== Text layout algorithm: An error with a character with both of 'x' and 'dx (or 'y' and 'dy') ==
URL: https://svgwg.org/svg2-draft/text.html#TextLayoutAlgorithm
See "4. Adjust positions: dx, dy" and "6. Adjust positions: x, y"

> 4.2.2. Let shift.x = shift.x + resolve_x[i] and ... (Note: resolve_x should be resolve_dx)
> 4.2.3. Let result[i].x = CSS_positions[i].x + shift.x and  ...
> 6.3.1. If resolved_x[index] is set, then let shift.x = resolved_x[index] − result.x[index].
> 6.3.3 Let result.x[index] = result.x[index] + shift.x and ...

If 'x' and 'dx' attributes are specified to a character at [i], result[index].x becomes resolved_x[index] according to the current algorithm.  It ignores resolve_x[i] unlike existing SVG implementations.
Reason:
  4.2.2: shift.x = resolve_dx[i]
  4.2.3: result[i].x = CSS_positions[i].x + resolve_dx[i]
  6.3.1: shift.x = resolved_x[index] - CSS_positions[i].x - resolve_dx[i]
  6.3.3: result[index].x = CSS_positions[i].x + resolve_dx[i] + resolved_x[index] - CSS_positions[i].x - resolve_dx[i]
                                      = resolved_x[index]

IMO 6.3.1 should be "shift.x = resolved_x[index] - CSS_positions[index].x."



Please view or discuss this issue at https://github.com/w3c/svgwg/issues/845 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 27 April 2021 00:42:33 UTC