NewsWorld
PredictionsDigestsScorecardTimelinesArticles
NewsWorld
HomePredictionsDigestsScorecardTimelinesArticlesWorldTechnologyPoliticsBusiness
AI-powered predictive news aggregation© 2026 NewsWorld. All rights reserved.
Trending
TrumpTechnologyFebruaryIranDiplomaticSignificantTensionsTimelineMilitaryPolicyDigestChinaFacesRegionalChineseCompanyWarnerTurkeyCrisisStatesFridayTradeDrugParamount
TrumpTechnologyFebruaryIranDiplomaticSignificantTensionsTimelineMilitaryPolicyDigestChinaFacesRegionalChineseCompanyWarnerTurkeyCrisisStatesFridayTradeDrugParamount
All Articles
Writing a Guide to SDF Fonts
Hacker News
Published about 4 hours ago

Writing a Guide to SDF Fonts

Hacker News · Feb 27, 2026 · Collected from RSS

Summary

Article URL: https://www.redblobgames.com/blog/2026-02-26-writing-a-guide-to-sdf-fonts/ Comments URL: https://news.ycombinator.com/item?id=47183725 Points: 7 # Comments: 0

Full Article

Back in 2024 I learned about SDF (signed distance field) rendering of fonts. I was trying to implement outlines and shadows in a single pass instead of drawing over the text multiple times in different styles. I intended to use these fonts for two different projects, a game and a map generator. I got things working but didn’t fully understand why certain things worked or didn’t work. I wrote some notes on my site about what I tried. In the end, I stopped working on both the game’s fonts and the map generator, so I put all of this on hold. Fast forward to late 2025, and my incomplete notes sometimes show up on the first page of search results for “sdf fonts”[1]! Surely that isn’t the best page on the topic. It would be better to point to library documentation or maybe one of the research papers about the topic. My page isn’t that good. Initially my thought was “search engines are in their decline” but then I decided “this is an opportunity”. I decided to make a page worthy of being the top search result. I first looked through everything I had written. I already had started an “overview” page but hadn’t gotten very far on it. I also have 22 separate pages that were “diary style”, about what I did rather than what you should know. The overview page covered how to use various SDF font libraries (msdfgen, stb_truetype, tiny-sdf, etc.). I wrote code for multiple libraries, had sketched out diagrams for various concepts, and had screenshots of outputs from each of those libraries. Sketched out concepts, using Excalidraw[2] At some point I realized the scope was too large. I had spent the most time with msdfgen and hadn’t yet learned enough about the other libraries to write a proper guide. They all worked differently. I kept getting stuck. So I reduced the scope. In redesign 2 I decided to only use msdfgen, but show the various tradeoffs involved (atlas size, antialias width, shader derivatives, smoothing function). I made several diagrams for concepts, such as: Diagrams from redesign 2, using Excalidraw[3] And I started running tests. I wanted to compare the effect of atlas size, so I made lots of screenshots and started looking closely. I wanted to come up with a way to recommend a specific size. I wanted to make recommendations for all the other parameters. I showed all the commands I ran. At some point I realized I could run tests forever. And I had already done that last year, and wrote it up in blog posts (one and two). Doing it again here didn’t seem especially valuable. So I pivoted to a “how to” page. In redesign 3 I decided to show the concepts, then a JavaScript implementation using CPU rendering, and then another implementation using GPU rendering. I made new versions of the diagrams: Diagrams from redesign 3, hand-written SVG I was making progress on that page but it didn’t feel like a Red Blob Games page. The page started out with tons of shell commands, and then showed lots of code. It felt like a page that only I would find useful. So I started over and designed a “concepts” page. In redesign 4 I focused on what effects I wanted, how SDF works, and how to use it to create those effects. I again reduced the scope by removing the implementation details. What I had already written, I moved to a separate (unpolished) page. And I never wrote a standalone downloadable project like I originally wanted. I had tried several ideas over the past year but didn’t make a lot of progress until I figured out what I actually wanted to put on the page: Work over the past year, using Cal-heatmap[4] I’m finally happy with the page. Take a look! I hope search engines point to it eventually.


Share this story

Read Original at Hacker News

Related Articles

Hacker Newsabout 3 hours ago
The Robotic Dexterity Deadlock

Article URL: https://www.origami-robotics.com/blog/dexterity-deadlocks.html Comments URL: https://news.ycombinator.com/item?id=47184744 Points: 49 # Comments: 31

Hacker Newsabout 3 hours ago
Red Dwarf creator Rob Grant has died

Article URL: https://www.beyondthejoke.co.uk/content/17193/red-dwarf-rob-grant Comments URL: https://news.ycombinator.com/item?id=47184480 Points: 42 # Comments: 7

Hacker Newsabout 4 hours ago
Leaving Google has actively improved my life

Article URL: https://pseudosingleton.com/leaving-google-improved-my-life/ Comments URL: https://news.ycombinator.com/item?id=47184288 Points: 210 # Comments: 119

Hacker Newsabout 4 hours ago
Let's discuss sandbox isolation

Article URL: https://www.shayon.dev/post/2026/52/lets-discuss-sandbox-isolation/ Comments URL: https://news.ycombinator.com/item?id=47184049 Points: 4 # Comments: 0

Hacker Newsabout 4 hours ago
Kyber (YC W23) Is Hiring an Enterprise Account Executive

Article URL: https://www.ycombinator.com/companies/kyber/jobs/59yPaCs-enterprise-account-executive-ae Comments URL: https://news.ycombinator.com/item?id=47183907 Points: 0 # Comments: 0

Hacker Newsabout 4 hours ago
Block spent $68M on a single party in September 2025

Article URL: https://twitter.com/BullTheoryio/status/2027250361816486085 Comments URL: https://news.ycombinator.com/item?id=47183660 Points: 67 # Comments: 34