W3C home > Mailing lists > Public > www-svg@w3.org > December 2011

text-anchor "middle" and "end" + dx

From: Mike Bostock <mbostock@cs.stanford.edu>
Date: Wed, 7 Dec 2011 10:10:47 -0800
Message-ID: <CAM36=qoPmy=VWCPmT5+KXC+8CODnt+ZwSZY9gYDAVauLreAQ4w@mail.gmail.com>
To: www-svg <www-svg@w3.org>
It appears that Firefox and Opera don't observe the dx attribute on
text elements in conjunction with text-anchor "middle" or "end". For
example, I would expect the dx attribute here to shift the text left
by 10 pixels, and it does on WebKit, but not Firefox:

  <text dx="-10" text-anchor="middle">Hello, world!</text>

This bug was reported more than three years ago, and I haven't seen
any progress on it:


Test case here:


It's fairly easy to work-around this behavior by modifying the x
attribute directly, but it's an annoying discrepancy between browsers.
Which behavior is correct?


(image/png attachment: expected.png)

(image/png attachment: actual.png)

Received on Wednesday, 7 December 2011 18:11:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:33 UTC