make SamsaGlyph.prototype.svg dynamically sized and responsive#76
make SamsaGlyph.prototype.svg dynamically sized and responsive#76wentin wants to merge 1 commit intoLorp:masterfrom
Conversation
update SamsaGlyph.prototype.svg function so the exported SVG's width and height is set dynamically with font.unitsPerEm this helps with fonts with non-standard canvas size. use `viewBox` instead of `width` and `height` to make the svg responsive
|
I don’t think a viewBox based on font.unitsPerEm is the way to do it, because all glyphs are scaled by 1000/unitsPerEm by a group in the SVG. BTW the reason I am not scaling the entire SVG is that I want to keep the sizes of UI elements (cartesian axes, point icons, arrows, outline stroke thickness) consistent for any value of unitsPerEm. |
|
@Lorp scaled by 1000/unitsPerEm by a group makes sense to me, in that case, the SVG width height should be hardcoded 1000. However I don't see the group being scaled when I call the |
|
The |
update SamsaGlyph.prototype.svg function so the exported SVG's width and height is set dynamically with font.unitsPerEm
this helps with fonts with non-standard canvas size.
use
viewBoxinstead ofwidthandheightto make the svg responsive