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.
> 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.
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.
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
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!
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.
The interesting engineering decision is keeping Bézier curve data on the GPU and resolving coverage at the fragment stage, rather than pre-rasterizing into an atlas. The atlas approach is faster on the hot path but breaks at oblique/perspective viewing angles, and glyphs rendered outside the cached size range look rough — both problems that matter for in-world text in games.
The hard part to replicate isn't the math (the paper covers it) — it's the edge case handling for self-intersecting curves and winding number computation for complex glyphs. CJK characters especially. Getting that right without per-character preprocessing is the subtle bit.
The open-source announcement is the real news. msdfgen is the most widely used alternative but doesn't have the same production validation Slug has from a decade of game engine use.
Glyph complexity has no effect on the calculations done in the pixel shader and does not change how glyphs are preprocessed. There are no edge cases. If you'd like to see some ridiculously complex fonts get rendered with Slug, check out the 8th page in the demo at sluglibrary.com. Some of those individual glyphs are composed of over 1000 Bézier curves!
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!
This is great news. With the speed of hardware these days, there's really no excuse not to render glyphs directly from the Bézier curves with analytic anti-aliasing. Past solutions like texture atlases and SDFs always felt like a hack and produced sub-par results at arbitrary scales. Hopefully with the open-sourcing of Slug, more major libraries and game engines will adopt the high quality approach.
You can buy them from various manufacturers that make them; you often get unsolicited mail from them as your name and address is on the patent filings.
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!
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!!
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).
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.
> 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.
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.
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
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!
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.
SDF rendering is just a fuzzy blobby approximation.
You do realize he could've just kept it until 2038, right? This was completely unforced.
Software patents valid for 8 years is actually something I could get behind.
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.
The interesting engineering decision is keeping Bézier curve data on the GPU and resolving coverage at the fragment stage, rather than pre-rasterizing into an atlas. The atlas approach is faster on the hot path but breaks at oblique/perspective viewing angles, and glyphs rendered outside the cached size range look rough — both problems that matter for in-world text in games.
The hard part to replicate isn't the math (the paper covers it) — it's the edge case handling for self-intersecting curves and winding number computation for complex glyphs. CJK characters especially. Getting that right without per-character preprocessing is the subtle bit.
The open-source announcement is the real news. msdfgen is the most widely used alternative but doesn't have the same production validation Slug has from a decade of game engine use.
Glyph complexity has no effect on the calculations done in the pixel shader and does not change how glyphs are preprocessed. There are no edge cases. If you'd like to see some ridiculously complex fonts get rendered with Slug, check out the 8th page in the demo at sluglibrary.com. Some of those individual glyphs are composed of over 1000 Bézier curves!
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...)
What stack are those people using?
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!
This is great news. With the speed of hardware these days, there's really no excuse not to render glyphs directly from the Bézier curves with analytic anti-aliasing. Past solutions like texture atlases and SDFs always felt like a hack and produced sub-par results at arbitrary scales. Hopefully with the open-sourcing of Slug, more major libraries and game engines will adopt the high quality approach.
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...
Love it when someone who makes complex, helpful software is rewarded for their efforts. More stories like this!
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!
Is it on ShaderToy yet? :D
> 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?
I took care of the whole thing myself without lawyers, so I ended up paying something like $950 in various filing fees.
How did you get that diploma/plaque, is that something every patent author will have?
The plaque was a personal order from one of the many companies that make them. What you actually get from the USPTO looks like this: https://x.com/EricLengyel/status/1159917092331642880/photo/1
You can buy them from various manufacturers that make them; you often get unsolicited mail from them as your name and address is on the patent filings.
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!
Awesome algorithm and thank you for donating it to open source!
Finally, some good video game development news!
Lengyel continues to be standup dude, kudos!
Thank you!
this is very cool
Amazing! Thank you, Eric!
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!!
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).
Thank you for your service!
Here's an alternate if you're also getting connection reset errors:
https://web.archive.org/web/20260317185928/https://terathon....
We'll put that link in the toptext as well. Thanks!