| ▲ | A Decade of Slug(terathon.com) |
| 614 points by mwkaufma 15 hours ago | 59 comments |
| https://web.archive.org/web/20260317185928/https://terathon.... |
|
| ▲ | miloignis 15 hours ago | parent | next [-] |
| This is wonderful news, and my sincere thanks to the author.
I remember coming upon this algorithm several years ago, and thinking it was extremely elegant and very appealing, but being disappointed by the patent status making it unusable for FOSS work. I really appreciate the author's choice to dedicate it to the public domain after a reasonable amount of time, and congratulations on the success it had while proprietary! Now if I ever get around to writing that terminal emulator for fun, I'll be tempted to do it with this algorithm for the code's aesthetic appeal. |
| |
| ▲ | olejorgenb 13 hours ago | parent | next [-] | | > 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. The patent has already served its purpose well, and I believe that holding on to it any longer benefits nobody. Therefore, effective today, I am permanently and irrevocably dedicating the Slug patent to the public domain. | | |
| ▲ | convexhulled 13 hours ago | parent [-] | | Yes, now that SDF font rendering is the industry's preference, he drops the software patent. That is, he is dropping the patent because it isn't a commercially viable piece of software, not because he is ethically opposed to it. Great virtue signaling though. | | |
| ▲ | dwroberts 13 hours ago | parent | next [-] | | Seems more like he had the patent long enough to build a sustainable business from his own work, and now he’s been able to earn enough from it that others’ implementations aren’t a risk to him. Which is kind of the entire point of patents, just that they last way too long relative to the speed of technological progress | |
| ▲ | flohofwoe 3 hours ago | parent | prev | next [-] | | SDF font rendering was common long before Slug, and Slug is supposed to be the better solution (I haven't used it though, so cannot comment on its pros and cons vs SDF, but one obvious disadvantage of SDF is that you still need a font atlas texture, and that can get very big if you need to render some East Asian character sets). | |
| ▲ | skullt 13 hours ago | parent | prev | next [-] | | SDF font rendering has been around 20+ years though? Valve really popularized in their 2007 SIGGRAPH paper and Chlumský developed MSDF font rendering in a 2015 thesis. | |
| ▲ | flipgimble 11 hours ago | parent | prev | next [-] | | SDF font rendering was an industry standard maybe from 2007-2010. and you probably won’t believe what happened to OpenGL since then. Don’t even look into at what people are doing with GPUs these days, you won’t like it one bit! | |
| ▲ | ZeWaka 13 hours ago | parent | prev | next [-] | | You do realize he could've just kept it until 2038, right? This was completely unforced. | |
| ▲ | LoganDark 9 hours ago | parent | prev [-] | | SDF rendering is just a fuzzy blobby approximation. | | |
| ▲ | flohofwoe 3 hours ago | parent [-] | | For that it works surprisingly well though, unless you need tiny text. |
|
|
| |
| ▲ | actionfromafar 14 hours ago | parent | prev [-] | | Software patents valid for 8 years is actually something I could get behind. | | |
|
|
| ▲ | Lichtso 20 minutes ago | parent | prev | next [-] |
| 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 |
|
| ▲ | astroalex 12 hours ago | parent | prev | next [-] |
| I used Slug at a previous job. It is an excellent, artfully crafted library; really the pinnacle of software engineering in my opinion. Thanks to the author for donating the algorithm to the public domain! |
|
| ▲ | cachius 13 hours ago | parent | prev | next [-] |
| 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. |
| |
| ▲ | amluto 11 hours ago | parent [-] | | 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...) | | |
| ▲ | delta_p_delta_x 4 hours ago | parent | next [-] | | > But I don't actually know many people still doing any of this sort of work on Windows. Most primary, secondary, and pre-university school teachers without an institutional understanding of LaTeX, which admittedly has an extremely high (technical, not financial) barrier to entry compared to Microsoft Word + MathType. This is what my secondary school teachers used, for instance. They're given bog-standard laptops with Windows to work with. Also exam setters and writers in places like Cambridge University Press and Assessment. If you took a GCSE, O-level, or A-level exam administered by them, it had pretty high quality typesetting for maths, physics diagrams, chemistry skeletal diagrams and reaction pathways... But almost none of it was done with LaTeX, and instead probably all add-ons to Microsoft Word or Adobe InDesign. | |
| ▲ | nikanj 35 minutes ago | parent | prev | next [-] | | Depressingly I don't actually know many people still doing any of this sort of work, on any platform. | |
| ▲ | mmooss 10 hours ago | parent | prev [-] | | What stack are those people using? | | |
| ▲ | kibibu 7 hours ago | parent [-] | | He has a post up: https://terathon.com/blog/radical-pie.html I'm pretty confident the "stack" is C++ on Win32, with a bunch of hand-rolled libraries and no stdlib. | | |
| ▲ | Sammi 4 hours ago | parent | next [-] | | Will probably run great in Proton. | |
| ▲ | mmooss 7 hours ago | parent | prev [-] | | Hmmm ... the GP says > I don't actually know many people still doing any of this sort of work on Windows. | | |
| ▲ | kibibu 7 hours ago | parent [-] | | I think they meant writing complex equations on windows | | |
| ▲ | mmooss 5 hours ago | parent [-] | | Or doing work that regularly involves writing complex equations, which is what I was asking about - what field and what do they use? |
|
|
|
|
|
|
|
| ▲ | amelius an hour ago | parent | prev | next [-] |
| > 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. |
|
| ▲ | sbinnee 3 hours ago | parent | prev | next [-] |
| I am not at all familiar with game development. This article reminds me of Casey Muratori mentioning a font issue in game development environment from a random podcast. On web, you can just fetch a google font whatever. No problem. On a local machine, you tend to look a well-established software like harfbuzz. But then harfbuzz could be rather a big dependency. A game is self-contained and you want your font looks cool and unique to your game, like the Diablo font. So it becomes a design issue. It's an awesome approach to let GPU render fonts. I cannot imagine how many game devs had font issues where they realized that they might have to learn how to render fonts as well not just characters and grass. |
| |
| ▲ | flohofwoe 3 hours ago | parent [-] | | > well-established software like harfbuzz Harfbuzz is only one piece of the puzzle, it's not a text renderer, only a 'text shaper' (e.g. translating a sequence of UNICODE codepoints into a sequence of glyphs). The actual font handling and text rendering still needs to be done by some other code (e.g. the readme in Mikko Mononen's Skribidi project gives a good overview about what's needed besides the actual rendering engine: https://github.com/memononen/Skribidi/) |
|
|
| ▲ | amagitakayosi 9 hours ago | parent | prev | next [-] |
| Amazing, Thank you Eric!! Also, Microsoft's Loop-Blinn patent for cubic curves will expire on March 25. These might change the landscape of text rendering... |
| |
| ▲ | cylemons 2 hours ago | parent [-] | | I thought loop-blinn expired a while ago, or is the cubic curves separate from quadratic? | | |
|
|
| ▲ | tokyovigilante 7 hours ago | parent | prev | next [-] |
| Thanks Eric, much appreciated. How would you compare your approach to something like Vello (https://github.com/linebender/vello)? |
| |
| ▲ | elengyel 5 hours ago | parent [-] | | 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. | | |
| ▲ | Ono-Sendai 2 hours ago | parent [-] | | 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? | | |
| ▲ | Lichtso 11 minutes ago | parent | next [-] | | 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. | |
| ▲ | kevthecoder 36 minutes ago | parent | prev [-] | | 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). | | |
|
|
|
|
| ▲ | weslleyskah 3 hours ago | parent | prev | next [-] |
| So nice to see this here.
The author's books are awesome resources for graphics and C++. It's a shame there seem to be fewer print editions available these days!? |
|
| ▲ | byearthithatius 14 hours ago | parent | prev | next [-] |
| Love it when someone who makes complex, helpful software is rewarded for their efforts. More stories like this! |
|
| ▲ | Vipitis 14 hours ago | parent | prev | next [-] |
| I am sorta in a position where implementing a glyph renderer as a compute shader would be helpful. This is a great opportunity to use this as a reference... exciting weekend project! |
|
| ▲ | Cthulhu_ 13 hours ago | parent | prev | next [-] |
| Damn, I worked with the author's game engine (C4) about... 20 years ago now while still in school, didn't know they were still active in that area! |
|
| ▲ | andai 8 hours ago | parent | prev | next [-] |
| This is super cool. A few years ago I was wondering if Ruffle could do something similar, incorporate some kind of GPU accelerated vector graphics. At the time they were going with, approximating the curves out of triangles. I don't know if they're still doing that though. |
|
| ▲ | VikingCoder 14 hours ago | parent | prev | next [-] |
| Is it on ShaderToy yet? :D |
|
| ▲ | lacoolj 13 hours ago | parent | prev | next [-] |
| > But I think that’s too long. The patent has already served its purpose well, and I believe that holding on to it any longer benefits nobody. Damn dude didn't you pay like ... over $10k for that patent? |
| |
| ▲ | elengyel 12 hours ago | parent [-] | | I took care of the whole thing myself without lawyers, so I ended up paying something like $950 in various filing fees. | | |
| ▲ | kzrdude 12 hours ago | parent [-] | | How did you get that diploma/plaque, is that something every patent author will have? | | |
|
|
|
| ▲ | valentinomici51 2 hours ago | parent | prev | next [-] |
| I've been following this project for a while. Nice to see the progress. |
|
| ▲ | swiftcoder 13 hours ago | parent | prev | next [-] |
| Lengyel continues to be standup dude, kudos! |
|
| ▲ | Validark 10 hours ago | parent | prev | next [-] |
| Awesome algorithm and thank you for donating it to open source! |
|
| ▲ | adamrezich 12 hours ago | parent | prev | next [-] |
| Finally, some good video game development news! |
|
| ▲ | leecommamichael 13 hours ago | parent | prev | next [-] |
| Thank you! |
|
| ▲ | maximilianburke 13 hours ago | parent | prev | next [-] |
| Amazing! Thank you, Eric! |
|
| ▲ | forrestthewoods 14 hours ago | parent | prev | next [-] |
| Oh wow this is crazy. This was a project that was reasonably successful commercially. And now it’s just being given away open source? What an absolutely incredibly gift to the community!! |
| |
| ▲ | aseipp 13 hours ago | parent [-] | | Not quite, just the pixel/vertex shaders and the algorithm is public domain. Slug "the software package" is not open source (you can get a copy of it along with C4 Engine for $100 to take a peek if you want, though). |
|
|
| ▲ | moralestapia 15 hours ago | parent | prev | next [-] |
| Thank you for your service! |
|
| ▲ | rrauenza 14 hours ago | parent | prev | next [-] |
| Here's an alternate if you're also getting connection reset errors: https://web.archive.org/web/20260317185928/https://terathon.... |
| |
|
| ▲ | Iamkkdasari74 10 hours ago | parent | prev [-] |
| this is very cool |