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:

  https://bugzilla.mozilla.org/show_bug.cgi?id=454970

Test case here:

  http://zajec.net/bug/view/svg.text.anchor

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?

Mike


expected.png
(image/png attachment: expected.png)

actual.png
(image/png attachment: actual.png)

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

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:50 GMT