Live data from Hacker News

TinyVG: A challenger to the throne of vector graphics

zig.news

101–110 of 196 posts

Re: TinyVG: A challenger to the throne of vector graphics

#102

> How will this look in different browsers? Let's test! obviously different font widths for rendering of SVG text in different browsers/font stacks > That didn't go as expected. I thought that at least both files on my Linux machine look the same, but it seems like Firefox doesn't like the font-size specification, while Chrome and Edge do. I asked the Render-A-Webpage-As-An-SVG-framework guy about this last week. He…

What’s the deal? The font-size declaration in the style attribute was invalid, and Chromium allowed it, in direct contravention of both the SVG 1.1 and 2 specs, while Firefox disallowed it.

SVG 1.1 extends CSS 2’s font-size value to allow a unitless number on a font-size SVG attribute https://www.w3.org/TR/SVG11/text.html#FontSizeProperty>, but when you specify it as a CSS style it must follow the CSS declaration form, which means that non-zero lengths must include a unit—https://www.w3.org/TR/SVG11/styling.html#StyleAttribute> even explicitly mentions font-size as its example on this point.

SVG 2 removes the unitless number extension and defers to CSS Fonts Module Level 3 entirely for font-size, so that unitless non-zero numbers aren’t permitted even in a font-size attribute.

All up, it’s a bad example that doesn’t support the thesis in the slightest, because a rookie error was made. (There’s still something in the fact that such an error could be made so easily, but it’s not that big a deal, certainly not enough to suggest that text is unreliable beyond the fact that you don’t know what fonts are available.)

Text in SVG is just as good as text in HTML, except inasmuch as nothing implements runtime (font-dependent) line wrapping, so it’s kinda more like HTML with white-space:nowrap.

The interactions between presentation attributes and style properties are a bit fiddly and sometimes unclear. Take something like ; it’s not quite clear to me whether this is valid in SVG 1.1, though I think it should be in SVG 2. It works in both Firefox and Chromium, though Firefox logs a claim that it’s invalid in the dev tools. , on the other hand, is definitely fine.

Re: TinyVG: A challenger to the throne of vector graphics

#103
post #71

> How will this look in different browsers? Let's test! obviously different font widths for rendering of SVG text in different browsers/font stacks > That didn't go as expected. I thought that at least both files on my Linux machine look the same, but it seems like Firefox doesn't like the font-size specification, while Chrome and Edge do. I asked the Render-A-Webpage-As-An-SVG-framework guy about this last week. He…

> So what's the deal? Are OP and me the only devs who have ever hit up against this issue in practice? The sad truth is that many issues go unreported because people are lazy and move on when they hit a roadblock. Also, I've seen this problem reported more than a few times so you're not alone.

I've seen impressive amounts of code written to get around one line bugs that could be trivially fixed, if only reported. One time, the LOC of the workaround basically matched the LOC of the tool, with the workaround implementing a full parser to consume the output of the tool, rather than just directly loading the json the tool was consuming. I used to get frustrated at these things, but I've become a bit demented, reveling in the asinine, self inflicted, suffering that I sometimes witness. Watching people copy paste code changes, rather than using git, is an infinite source of entertainment that's seemingly impossible to stop.

Re: TinyVG: A challenger to the throne of vector graphics

#104
post #83
post #52

Earlier quoted context omitted.

Franky somebody should do like a TinyDF replacement for pdf... That's also a somewhat bloated format at this point. Ideally though, the tiny* formats should be forward compatible (?) and interpretable as a valid non-Tiny* document. That would be quite nice for wider adoption (like JSON).

"somewhat bloated" is the understatement of the century. PDF documents can contain executable code in two different programming languages (JavaScript and PostScript), interactive content, digital signatures, their own form of encryption, and more. Why they thought adding JavaScript to an already infamous attack vector of a format is beyond my understanding.

Javascript was added to PDF in order to implement interactive and dynamic forms, including input validation and normalization and dynamically adding/removing form elements based on user interaction. The contents of forms can also be directly submitted to a server. Basically, Adobe didn’t want HTML forms to steal their show, so they implemented the equivalent with PDF. Not saying that was a good idea, but here you go.

Re: TinyVG: A challenger to the throne of vector graphics

#105
post #65

> How will this look in different browsers? Let's test! obviously different font widths for rendering of SVG text in different browsers/font stacks > That didn't go as expected. I thought that at least both files on my Linux machine look the same, but it seems like Firefox doesn't like the font-size specification, while Chrome and Edge do. I asked the Render-A-Webpage-As-An-SVG-framework guy about this last week. He…

That's a good question! I fell for this problem with text rendering once as the font i've used in a SVG wasn't installed on the target machine. If i create a image, i want that image to look exactly the same on all machines. This is sadly not the fact for SVG :( The W3C SVG example files contain a lot of these files that make every SVG renderer explode. There's images that don't render anywhere except inkscape

This is a problem with any image format. Either you embed the font (or parts of it), or convert the text to curves.

Re: TinyVG: A challenger to the throne of vector graphics

#106

Earlier quoted context omitted.

IMO as long as animation isn't tied to After Effects like Lottie is, you can't go wrong. The fact that the most popular open vector animation format is tied to an expensive, proprietary piece of software that isn't even primarily a vector art package makes me very sad…

Not to mention After Effects is an extremely poorly performing and highly bloated piece of software tied to mountains of spyware… It’s almost impressive how bad the software is by modern standards.

I find After Effects to be one of the most impressive pieces of creative software ever made. An entire industry had been built around it. That said, there is plenty to improve upon.

Re: TinyVG: A challenger to the throne of vector graphics

#107
@ikskuh -I do not see any mention of layers or grouping in the specification (unless it went by some other terminology I missed in my skim). In the blog post you said you wanted to avoid having an "authoring" file and a "redistributable" version. I am far from an artist but have hacked out a few .svg sketches and layers/grouping are a requirement for creating new content.

Re: TinyVG: A challenger to the throne of vector graphics

#110
post #65

> How will this look in different browsers? Let's test! obviously different font widths for rendering of SVG text in different browsers/font stacks > That didn't go as expected. I thought that at least both files on my Linux machine look the same, but it seems like Firefox doesn't like the font-size specification, while Chrome and Edge do. I asked the Render-A-Webpage-As-An-SVG-framework guy about this last week. He…

That's a good question! I fell for this problem with text rendering once as the font i've used in a SVG wasn't installed on the target machine. If i create a image, i want that image to look exactly the same on all machines. This is sadly not the fact for SVG :( The W3C SVG example files contain a lot of these files that make every SVG renderer explode. There's images that don't render anywhere except inkscape

> There's images that don't render anywhere except inkscape

You just have to convert the text in the image to a path before using it wherever you plan on, just be sure to save the original for editing.

Post reply on HN