Live data from Hacker News

An SVG is all you need

jon.recoil.org

91–100 of 155 posts

Re: An SVG is all you need

#91
I remember making an .svg spirit thermometer that polled our local weather station and scaled the red bar accordingly some 12 years ago. A nice gimmick but I didn't see any real use for it. We joked about making a single-image SCADA monitor screen.

Re: An SVG is all you need

#92

Around 15 years ago, I built a barbecue controller. This controller had four temperature probes that could be used to check the temperature of the inner cooking chamber as well as various cuts of meat. It controlled servos that opened and closed vents and had a custom derived PID algorithm that could infer the delayed effects of oxygen to charcoal. Anyway, of relevance to this thread is that the controller connected…

This sounds awesome. Did you ever filmed it working?

Exactly my thoughts! Where is the youtube video? :D I really want to see it. :)

Re: An SVG is all you need

#93
post #74

Earlier quoted context omitted.

PDF is a sad replacement for PS. As far as I can tell, it was an attempt to obscure PS, because alternative vendors were getting better as Postscript than the originators. (There was some justification in terms of 'Oh, a binary format like PDF is more space efficient.' But PDF never really was more efficient than compressed PS.) It's not that PS has vanished, but PS isn't nearly as 'everywhere' as HTML came to be.

From the perspective of someone who worked in printing and publishing starting in the 1980s, there's more to it than that. PostScript was and is terrific as a page description language and as a printer control language. It absolutely revolutionized the printing business. For the first time, you could get complete pages (as opposed to unpaginated galleys) out of high-end imagesetters. But it was not all that good as a…

I agree that postscript was far from perfect.

However we can imagine a world where some relatively minor evolutions in PS would have moved it into the right trajectory.

(Thanks for all the historic details!)

Re: An SVG is all you need

#94
post #74

Earlier quoted context omitted.

PDF is a sad replacement for PS. As far as I can tell, it was an attempt to obscure PS, because alternative vendors were getting better as Postscript than the originators. (There was some justification in terms of 'Oh, a binary format like PDF is more space efficient.' But PDF never really was more efficient than compressed PS.) It's not that PS has vanished, but PS isn't nearly as 'everywhere' as HTML came to be.

PDF is also a lot less powerful, purposefully so. You can start an infinite loop just by double-clicking a PS file, for instance. It is extremely useful to have a full programing language as a file format, though. I miss macOS’s Preview.app auto-converting PS to PDF when double-clicked. It was a way to easily distribute a document that could randomize question orders each time it opened, print multiple bingo cards fr…

You could have made a deliberately restricted subset of PS without going all binary.

Btw, doesn't PDF include Javascript these days? So you can still randomise stuff at view-time in a PDF. See https://th0mas.nl/2025/01/12/tetris-in-a-pdf/

Re: An SVG is all you need

#95

Downsides of using SVG: - cannot wrap text - cannot embed font glyphs - your SVG might be unreadable if the user doesn't have the font installed. You can convert letters to curves, but then you won't be able to select and edit text. It's such an obvious problem, yet nobody thought of it, how? Photoshop solved this long time ago - it saves both text and its rendering, so the text can always be rendered. - browsers do…

Safari supports base64-embedding font files in a ’s @font-face {} (iirc it's something like `@font-face { src: url('data:application/x-font-woff;charset=utf-8;base64,...'); }`) that can then be referenced as normal throughout the SVG. I don't recommend this though, nobody wants to deal with 500KB SVGs.

You can also point to font files with @font-face. I use a small custom font that's only 16 KB. Although, when opening the file locally, you have to first disable local file restrictions in safari's settings before it works...

  
  
  @font-face {
  font-family: 'A-font';
  src: url('A-font.woff') format('woff');
  font-weight: normal;
  font-style: normal; }
  
  

Re: An SVG is all you need

#96

"SVG Considered Harmful" https://www.cloudflare.com/cloudforce-one/research/svgs-the-...

First off, what kind of SVG reader does cloudflare assume to just open SVGs and Willy nilly run contained js? Is that a windows os feature? Second, do they not know about Content Security Policies?

And as a side note: Cloudflare itself is considered harmful

Re: An SVG is all you need

#97

Earlier quoted context omitted.

Safari supports base64-embedding font files in a ’s @font-face {} (iirc it's something like `@font-face { src: url('data:application/x-font-woff;charset=utf-8;base64,...'); }`) that can then be referenced as normal throughout the SVG. I don't recommend this though, nobody wants to deal with 500KB SVGs.

You can also point to font files with @font-face. I use a small custom font that's only 16 KB. Although, when opening the file locally, you have to first disable local file restrictions in safari's settings before it works... @font-face { font-family: 'A-font'; src: url('A-font.woff') format('woff'); font-weight: normal; font-style: normal; }

I don't think that helps with embedding fonts.

Re: An SVG is all you need

#98
I believe that would result in non accessible content, I believe screen readers cannot properly assist impaired users with SVG content.

As such I think it's not a good idea for a document that should have a large audience.

Re: An SVG is all you need

#99
post #40

Even though the article is mostly talking about visualizations, but I thought I'd share that I did at one point build a dance choreography software that renders the UI entirely SVG. I was surprised as to how well that worked. If you're curious, it's called StageKeep, and you can find it here. https://stagekeep.com/ The original project used React Three Fiber, but refactored it to SVG for reasons I don't quite remembe…

SVG was once hailed as the Flash-killer. With SVG + CSS + JavaScript you could do anything you could do with Flash, including those fancy Flash websites or complex applications. There just weren't any good authoring tools, while Flash had an amazing one.

Then Flash just died without being replaced by anything

Re: An SVG is all you need

#100
post #69

Earlier quoted context omitted.

What's wrong with SVG? Notebooks have their issues but are kinda this conceptually. I guess FLAs and Flash too. But you say we never developed a "client-side multimedia file format". Is that not exactly what html + js are for?

I mean the equivalent of a Word document: a file I can reasonably edit, including editing the multimedia and interactive/dynamic content, save, email, put on a thumb drive or Dropbox, etc.

I'd say that html+js suggestion of GP still holds, but with caveats. After all these years, HTML has everything needed for this, including images that can be embedded via the data URI scheme [1].

For example, I once adjusted an Object Pascal interactive program (target: Windows/Win32) for the browser target (FreePascal compiler has the JS target). An intermediate result was a bunch of files that worked locally on desktop but struggled on mobile. With a little help from the SingleFile extension [2], I ended up with a single HTML file containing all functionality and content. It worked great, for example, in MiXplorer's internal HTML viewer. I can't recall the exact details, but the file:/// protocol still had issues in Chrome, Firefox, or both. Anyway, preparing a local address correctly with a keyboard is a challenge so let's just assume that having capable file managers running local html files is enough

Sure, to make this manageable, you need good tools that handle all sides of the task. But at least in theory, the format is fully capable. My only global issue was that the state for locally run HTML files is a kind of ephemeral entity, but for interactive multimedia files, you may consider this obstacle small.

[1] https://en.wikipedia.org/wiki/Data_URI_scheme

[2] https://github.com/gildas-lormeau/SingleFile

Post reply on HN