-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supporting textBaseline #9
Comments
Since dominant-baseline is in the SVG 1.1 spec, I would say go ahead with mapping the values rather than adding in a hack for IE9. |
Just checked again and found http://bl.ocks.org/eweitnauer/7325338 I could use https://github.com/Pomax/Font.js but I think it's overkill. But yeah I would prefer |
Yup, IE looks about like the image below. To be fair though, chrome, FF and safari are returning differing results on the lesser used values (the SVG spec is huge), but since alphabetical, hanging and middle are somewhat reasonable I think it's ok to go ahead and map the values. I would rather keep a simple mapping with valid SVG, instead of forcing text position encoding into the output. (The other SVG viewers should in theory implement it properly in the future). |
I have a working
textBaseline
in 5031052 and 51a1860But with some problems..
5031052 uses
dominant-baseline
which isn't supported in IE51a1860 shifts y-coordiantes based on the
font.size
which works in IE, but does same strong assumptionsfontEmSize = fontEmSize / 1.25;
andfontSize = fontEmSize / 1.25;
http://www.w3.org/TR/2014/CR-2dcontext-20140821/#text-styles see graph,
too bad it's not possible to access the font metrics directly..
Any idea how to tackle this nicely ?
The text was updated successfully, but these errors were encountered: