Re: [svgwg] [svg-native] Should a viewBox be required? (#684)

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 <svg> 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.


-- 
GitHub Notification of comment by svgeesus
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/684#issuecomment-490293457 using your GitHub account

Received on Tuesday, 7 May 2019 23:43:24 UTC