stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

z2

@z2

Joined June 2nd, 2026

  • 7Devlogs
  • 1Projects
  • 0Ships
  • 0Votes
Open comments for this post

7h 29m 16s logged

Finally embedded the actual calculator (which was surprisingly easy, thanks desmos team!) Also, I fixed a bug where control points were being rounded to a grid at small font sizes.

I don’t think the current error metric for bezier curve flatness is good, since it’s a distance that depends on the size of the curve (which depends on font size). Maybe I could just scale the threshold by the font size, but I’d have to look more into it.

That’s why in the new screenshot, there are way too many samples, even though I set the tolerance slider to the max. The sampling now happens in glyph space, which is at a way larger scale (1em = around 1000 units) compared to the output space, and I forgot to change the slider’s bounds.

Also did a bunch of rewrites, and bumped the text shaping/font loading dependencies; their new API is so much simpler that I was able to get rid of a dependency I previously needed. It’s funny, but I regret that I had to deal with the old API.

0
0
27
Open comments for this post

1h 33m 31s logged

Implemented recursive subdivision sampling (why was this so easy?) Basically you split each cubic curve into two cub-curves at t=0.5, and repeat until the curve is approximately a line segment. Though I need to find error metrics that are easy to understand, the current one depends on font size.
Image: sample points in black, control points in blue

0
0
32
Open comments for this post

4h 13m logged

Refactoring and cleaning up, in preparation for at least 2 more sampling options (fixed density and adaptive). Also removed duplicated code so that the debug view actually reflects the polygon output, instead of doing its own text shaping. Have random code screenshots now

0
0
48
Open comments for this post

2h 44m 19s logged

Cleaned up the code and implemented a makeshift curve sampler. Currently I’m taking a fixed number of samples for each bezier segment in the glyph splines, so the resolution is inconsistent and there’s way more points than necessary in some places.

0
0
11
Open comments for this post

5h 45m 14s logged

Can now load .woff and .woff2 fonts, and the decompressed font & its shaper are stored globally instead of re-parsing every text update. I’m just outputting control points now, but soon I can finally implement the actual sampling. Also, something weird is going on with the Fira code variable font?

0
0
6
Open comments for this post

8h 48m 10s logged

Drawing text to an svg path. Also set up a debug ui to make sure the text shaping (glyph layout, ligatures, etc) is being done properly. For that, I ended up using a recent HarfBuzz port with basically no docs, which was really fun and not at all hard to understand. I also spent a lot of time searching up browser apis on MDN, and figuring out how to work with async.

Next up:

  • keep the parsed font loaded on the Rust side
  • detect and decompress .woff files
  • actually convert it to polygon
  • allow specifying fallback fonts
  • find out how to allow more formatted text (italic/bold, line breaks, centering, etc)
0
0
7

Followers

Loading…