Live data from Hacker News

A Decade of Slug

terathon.com

61–70 of 88 posts

Re: A Decade of Slug

#61

Thanks Eric, much appreciated. How would you compare your approach to something like Vello ( https://github.com/linebender/vello )?

Vello is intended more for general vector graphics and would probably perform better with pictures containing lots of large paths. Slug is designed specifically for rendering glyph-like objects and would perform better with lots of text and icons.

I was going to ask if Slug can be used as a general vector renderer. Or does it assume limits on e.g. number of curves/paths per area that are typical of fonts?

Re: A Decade of Slug

#62
> I was granted a patent for the Slug algorithm in 2019, and I legally have exclusive rights to it until the year 2038. But I think that’s too long.

This is cool but I did not know software patents were still a thing in the US.

Re: A Decade of Slug

#63

Earlier quoted context omitted.

Vello is intended more for general vector graphics and would probably perform better with pictures containing lots of large paths. Slug is designed specifically for rendering glyph-like objects and would perform better with lots of text and icons.

I was going to ask if Slug can be used as a general vector renderer. Or does it assume limits on e.g. number of curves/paths per area that are typical of fonts?

Eric answered a similar question on the Discord channel saying Slug is suitable for generic vector graphics. He recommends checking out the demo at https://sluglibrary.com/ (you can cycle through the examples with the space bar).

Re: A Decade of Slug

#64
post #28
post #11

His latest project is https://radicalpie.com/ A Professional Equation Editor for Windows 10/11 for 60$ that uses Slug for rendering. Presumably he‘s using it to write his great FGED books.

25 years ago I would have loved that. But I don't actually know many people still doing any of this sort of work on Windows. (I get it. It's an awesome replacement for MathType. It uses OLE so that it embeds in Microsoft Word nicely. Still...)

Depressingly I don't actually know many people still doing any of this sort of work, on any platform.

Re: A Decade of Slug

#65
There are two ways to get winding numbers and then decide on filled or empty by some rule like non-zero or even-odd:

a) The winding number of a point is the number of intersections of a scanline and a closed path.

b) The winding number around a point is the total angle subtended by the path at that point.

Slug uses approach a) and that comes with a lot of edge cases (see chart in the post) and numerical precision issues. The approach by loop & blinn uses b) and is thus simpler and more robust. Likewise the patent on that one expired too: https://news.ycombinator.com/item?id=47416736#47420450

Re: A Decade of Slug

#66

Earlier quoted context omitted.

I was going to ask if Slug can be used as a general vector renderer. Or does it assume limits on e.g. number of curves/paths per area that are typical of fonts?

Eric answered a similar question on the Discord channel saying Slug is suitable for generic vector graphics. He recommends checking out the demo at https://sluglibrary.com/ (you can cycle through the examples with the space bar).

Awesome, thanks.

Re: A Decade of Slug

#67

Earlier quoted context omitted.

Vello is intended more for general vector graphics and would probably perform better with pictures containing lots of large paths. Slug is designed specifically for rendering glyph-like objects and would perform better with lots of text and icons.

I was going to ask if Slug can be used as a general vector renderer. Or does it assume limits on e.g. number of curves/paths per area that are typical of fonts?

I think it is limited to integral quadratic bezier curves, which is sufficient for text rendering. But general purpose vector graphics almost certainly want rational cubic bezier curves too.

Re: A Decade of Slug

#68
Thanks, Eric; for this, and for my start as a software engineer — my first commercial development work was consulting as an 18 year old building games with C4. I'm really glad Slug was able to find commercial success for you in the way that C4 unfortunately wasn't able to.

For those of you who aren't familiar with Eric's work, he's basically the Fabrice Bellard of computer graphics.

Re: A Decade of Slug

#69
So now the algorithm is patent-free, and the vertex and fragment shaders are open-sourced with the MIT license, what we presumably need is some open-source code to take Bezier curves from a font file (or from the loaded data from FreeType or whatever), and process them into the data format that Slug expects.

Also thank you to Eric Lengyel, I have had my eye on Slug for a while and wished it was open-source.

Re: A Decade of Slug

#70
post #28
post #11

His latest project is https://radicalpie.com/ A Professional Equation Editor for Windows 10/11 for 60$ that uses Slug for rendering. Presumably he‘s using it to write his great FGED books.

25 years ago I would have loved that. But I don't actually know many people still doing any of this sort of work on Windows. (I get it. It's an awesome replacement for MathType. It uses OLE so that it embeds in Microsoft Word nicely. Still...)

I agree that it's a bit late but I don't think the issue is use of Windows (or Word, if that's what you're implying).

> It's an awesome replacement for MathType. It uses OLE so that it embeds in Microsoft Word nicely.

But that's the rub - OLE doesn't embed particularly nicely. I haven't used it in over a decade (maybe two?). It's sort of very softly deprecated.

The new equation editor in Word which isn't based on MathType, and doesn't use OLE, works much more smoothly than the old one, even if it doesn't support everything. ("New"? I just checked and it was introduced in 2007!) I think a typical user would have to be really desperate for extra functionality to abandon that level of integration, at which point you'd probably switch away from Word altogether.

Post reply on HN