Measuring how much text fits before the browser renders it.
To place text on a slide you have to know it fits before you draw it. Measuring with a canvas, wrapping Unicode correctly, and correcting for the gap between canvas and DOM.
Notes on what we build, how we think about systems, and what we learn along the way.
To place text on a slide you have to know it fits before you draw it. Measuring with a canvas, wrapping Unicode correctly, and correcting for the gap between canvas and DOM.
Where do the slide breaks go? A fixed character count cuts sentences and leaves uneven slides. How we turned the split into an optimization with a small cost model and dynamic programming.
Rasterizing an SVG to PNG through an image element races the font load and usually loses, so the export comes out in a fallback font. The fix is to convert text to vector paths before rasterizing, with HarfBuzz for shaping.
An SVG overlay can connect words across two lines of HTML, but only if it knows where the browser put them. How we measure word positions and keep the curves attached through wraps, resizes, and font loads.
A shareable link can carry the entire state of an app if you trim it, compress it, and version it. How we pack a full alignment into a few hundred characters, and read it back safely.
Every clickable word in the editor starts as a token, and a plain space split gets contractions, punctuation, and fixed phrases wrong. The tokenizer we built and the options it exposes.