Closed Pomax closed 8 years ago
While it's odd that SVGO is removing the transform="matrix(1 0 0 -1 0 0)"
(the part flipping the image) I'd be curious why MathJax writes everything upside down and then flips it after the fact... I'm not faimilar, perhaps their coordinate system is like Inkscape's?
Yes, it's an error in convertTransform
in the part where matrix is being decomposed (lost the sign of y-scale, therefore the error). I've got a solution, but not sure it's complete.
presumably because it extracts glyphs from OpenType fonts (it doesn't render text, it does glyph composition, LaTeX style), and font coordinates are "flipped" compared to virtually every other graphics context. positive Y values in font units "go up", like on paper, rather than "go down" like in a Canvas2D context.
Playing with the image on SVGOMG and unchecking the "Round/rewrite tranforms" (convertTransform
I presume) the transform is retained and the image is properly rendered (at least when you download the result, in my web browser nothing is displayed on SVGOMG).
I'm using svgo as CLI tool, what would that option be on the command line?
--disable=convertTransform
thanks! looking forward to the new version on npm
awesome!
I'm trying to clean up some SVG generated through MathJax, and svgo seems to rewrite essential transform and clipping information, leading to completely wrong SVGs.
For instance, here's an original SVG:
And here is its SVGO-cleaned version, which looks both flipped and clipped:
Something's going very wrong here.