Live data from Hacker News

Interacting with SVG

croscon.com

1–7 of 7 posts

Re: Interacting with SVG

#2
A couple of problems with SVG:

- Difficult to really mix with HTML elements, like video (the example here is kind of a border-case that works, but try for example clipping a video by a non-rectangular path).

- No hinting at smaller pixel-sizes, meaning that you'd need different SVGs for different pixel-sizes in order for them to look pretty at small sizes.

Re: Interacting with SVG

#3
post #2

A couple of problems with SVG: - Difficult to really mix with HTML elements, like video (the example here is kind of a border-case that works, but try for example clipping a video by a non-rectangular path). - No hinting at smaller pixel-sizes, meaning that you'd need different SVGs for different pixel-sizes in order for them to look pretty at small sizes.

> - No hinting at smaller pixel-sizes, meaning that you'd need different SVGs for different pixel-sizes in order for them to look pretty at small sizes.

One always assumes that SVG is infinitely scalable. Thanks for brining up this counterpoint. I guess "not everything is awesome".

Re: Interacting with SVG

#4
post #3
post #2

A couple of problems with SVG: - Difficult to really mix with HTML elements, like video (the example here is kind of a border-case that works, but try for example clipping a video by a non-rectangular path). - No hinting at smaller pixel-sizes, meaning that you'd need different SVGs for different pixel-sizes in order for them to look pretty at small sizes.

> - No hinting at smaller pixel-sizes, meaning that you'd need different SVGs for different pixel-sizes in order for them to look pretty at small sizes. One always assumes that SVG is infinitely scalable. Thanks for brining up this counterpoint. I guess "not everything is awesome".

I'm still having trouble understanding why it isn't, and could do with an example. Especially as pixel size isn't necessarily related to screen size.

Re: Interacting with SVG

#5
post #4
post #3

Earlier quoted context omitted.

> - No hinting at smaller pixel-sizes, meaning that you'd need different SVGs for different pixel-sizes in order for them to look pretty at small sizes. One always assumes that SVG is infinitely scalable. Thanks for brining up this counterpoint. I guess "not everything is awesome".

I'm still having trouble understanding why it isn't, and could do with an example. Especially as pixel size isn't necessarily related to screen size.

It is infinitely scalable. What amelius is saying is that there's no font hinting at all ("at smaller pixel-sizes" probably meaning rather at small font sizes, which is when you need hinting).

Hinting is a very complex operation (basically, you align letter's lines with the pixels on the screen) which is only useful when the display's DPI is low enough that you can see the pixels on the screen. SVG was never really intended for these cases, it's rather intended for high-DPI, "next gen" displays. However, I'm not sure if low DPI screens will ever go away. So will SVG always have this "blurry text" problem?

Hinting would be a really cool feature to have but also very difficult to implement gracefully. Usually hinting is done differently on every OS - by the Freetype library on Linux, by ClearType on Windows, and not at all on OSX. That kind of thing is difficult to incorporate into a standard - Do we accept that it will look unpredictably different everywhere? Do we force every SVG renderer to ship with freetype?

Re: Interacting with SVG

#6
post #3
post #2

A couple of problems with SVG: - Difficult to really mix with HTML elements, like video (the example here is kind of a border-case that works, but try for example clipping a video by a non-rectangular path). - No hinting at smaller pixel-sizes, meaning that you'd need different SVGs for different pixel-sizes in order for them to look pretty at small sizes.

> - No hinting at smaller pixel-sizes, meaning that you'd need different SVGs for different pixel-sizes in order for them to look pretty at small sizes. One always assumes that SVG is infinitely scalable. Thanks for brining up this counterpoint. I guess "not everything is awesome".

You can make SVG responsive and thus change the image depending on size http://demosthenes.info/blog/744/Make-SVG-Responsive

Re: Interacting with SVG

#7
post #4
post #3

Earlier quoted context omitted.

> - No hinting at smaller pixel-sizes, meaning that you'd need different SVGs for different pixel-sizes in order for them to look pretty at small sizes. One always assumes that SVG is infinitely scalable. Thanks for brining up this counterpoint. I guess "not everything is awesome".

I'm still having trouble understanding why it isn't, and could do with an example. Especially as pixel size isn't necessarily related to screen size.

SVG renderers perform badly at small pixel sizes, as they don't do stuff like subpixel rendering. Those techniques are usually employed in font rendering.

Another issue is that you usually want reduced complexity at small render sizes. So you have a few additional .svg's that get used just at one small size.