Hacker News new | ask | show | jobs
by jahewson 4885 days ago
Embedding other font formats in HTML != my SVG file can be rendered un-modified. If you put the raw SVG file in the browser it does not render. The SVG fonts would have to be extracted on the server side and converted to webfonts + CSS.

SVG rendered via an <img> tag has restrictions in browsers, for example Firefox will not allow the SVG to reference an external image file such as a jpg. Once again, you put the raw SVG file in the browser and it does not render...

Obviously I miss any SVG 1.2 feature which Inkscape lets me easily use. Compositing for example. User has "SVG" output from Inkscape, user puts it on an "SVG" hosting service, it does not render in the browser = unhappy user. Users don't care less about what version of SVG they are using.

Stripping browser-incompatible elements could be useful, for example, if I place my content inside an SVG 1.2 <page> then the browser will render nothing at all, where as if the server stripped out the <page> element first, I'd be able to see my content. Obviously this applies only to a single page tag. Once again, you put the raw SVG file in the browser and it does not render...

Bug-workarounds are the primary reason for wanting to manipulate the elements though, there is a Safari bug which can cause it to ignore <defs> but work if you switch out <defs> for <g>. Once again, you put the raw SVG file in the browser and it does not render...

1 comments

Just because browsers can't render poorly authored SVG files doesn't mean that the format is not ready for prime use. Except for filters, animations and fonts, all modern browsers have good support for SVG 1.1, there are definitely fewer issues than with say CSS3 transitions or flexbox which are nonetheless misused by web develoeprs.

Inkscape is doing layer compositing by applying filters on groups. This is not SVG 1.2 feature. It was present in SVG 1.1 for years and it's still not properly implemented by all browsers and authoring tools: http://www.w3.org/TR/SVG/filters.html#feBlendElement

> all modern browsers have good support for SVG 1.1

That is simply not true, as I've explained above. You can't call an SVG 1.1 file poorly authored because Safari has a bug displaying it, or Firefox doesn't support the filter you used. The fault is with the browser, not the end user.

> It was present in SVG 1.1 for years and it's still not properly implemented by all browsers

Now you're just contradicting yourself! Though "good support" was an ambiguous weasel phrase in the first place.

It's clear that you don't know much about what browsers do and don't support and what bugs exist, because your previous answer was so naively wrong. You need to not just trust statements like "supports SVG 1.1" on Wikipedia and actually apply your mind to discovering the nuanced details of what's actually out there.

I'm not contradicting myself, as I said: except for filters, animations and fonts, all modern browsers have good support for SVG 1.1. By "good support" I mean it's on pair or even better than HTML5 and CSS3 support.

Files that break cross-origin policy or use non-standard tags are poorly authored by my standards.

I have a lot of experience with SVG under WebKit-based browsers and so far everything renders just fine for me except for advanced features mentioned earlier.