You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A viewBox on the containing <svg> element gives the image an intrinsic aspect ratio & makes percentage lengths predictable (the convert to the same px values regardless of image scale), so that the graphic reliably scales up & down like an image (all parts scaling equally).
SVG in OpenType does not currently require a viewBox, but it's less of an issue there because the size & aspect ratio of each glyph is defined by other font data.
As Chris notes in #667 (comment), EPS requires a declared bounding box for similar reasons.
The text was updated successfully, but these errors were encountered:
SVG in Opentype doesn't require viewBox but does allow it (several examples use it); if used there is the additional constraint specific to that environment:
Note: When using a viewBox attribute on the element, it is important to specify unitsPerEm for width and height values to avoid a scaling effect.
The advantage of requiring it is that implementations do not need to scan over all the coordinates used and guess what the actually used range of coordinates should be.
I remember a common utility tool, BBFig was used to run over a PS file and a) compute the minimal bounding box b) remove any showpage command, to make EPS files.
I could certainly imagine a similar tool that helps turn a random SVG file into an ESVG file. Applications exporting to ESVG would already have the info needed to export a viewBox, there is no reason for them not to do so.
There would be a disadvantage for hand authoring (unless there was tooling support) in requiring a viewBox, but I don't think that is a primary use case and it is readily realt with by linting or post-processing tools.
Overall I tend towards requiring viewBox, ideally as a MUST, if not then at least a SHOULD.
A
viewBox
on the containing<svg>
element gives the image an intrinsic aspect ratio & makes percentage lengths predictable (the convert to the same px values regardless of image scale), so that the graphic reliably scales up & down like an image (all parts scaling equally).SVG in OpenType does not currently require a viewBox, but it's less of an issue there because the size & aspect ratio of each glyph is defined by other font data.
As Chris notes in #667 (comment), EPS requires a declared bounding box for similar reasons.
The text was updated successfully, but these errors were encountered: