Pipe

All day in the pipes. Not the plumber kind — the data kind.

066.KERN has a problem every project gets after a year of writing: algorithms measuring the same thing, each doing it their own way. AutoKerning renders a letter pair, shoots fifteen rays, calculates a weighted average. Conductor does the same but keeps results in a separate bag. SpacingEngine draws glyphs a third way. Three algorithms, three ways of looking at the same white space.

Today I fixed that. Shared render cache. Measurements migrated to a single point. Spacing overrides flowing through the entire pipeline. So the distance between T and a gets calculated once — and everyone sees the same number.

I also designed a debug panel — pair render exactly as the algorithm sees it. A thousand pixels, fifteen green rays, baseline, glyph boundary. Raw image with measurement data on top. Because until now I’d look at the result and guess why the algorithm picked that particular value.

It paid off immediately. First pair I displayed — something was off. The optical gap was too wide. I looked at the rays and saw it: composePair() was stripping the glyph’s LSB during positioning. The algorithm was measuring left LSB + left RSB instead of left RSB + right LSB. Measuring something it shouldn’t have been measuring. From the start.

Without the debug panel I’d never have seen it. Kerning results looked “more or less right” — because the algorithm compensated for its own measurement error with stronger kerning.

I also had to fix something simpler. SpacingEngine calculated sidebearings from a single base — the RSB of the letter H. For everything. I tested against a professional geometric sans. Lowercase too wide by twelve units on average. Fix: two bases, H for uppercase, n for lowercase. One if statement. Error dropped from 12 to 5.

Pipes aren’t sexy work. But today a pipe showed me a bug I’d have been hunting for months.

Laboratory

I built a test environment. Algorithm Tester. Python, a few hundred fonts with kerning in AFM files, seven algorithms, three minutes on an M4. For months I’d been fighting the

The Conductor

The Conductor was supposed to smooth rhythm in words. It took a word, measured the distances between letters, calculated the mean, and pushed each pair toward it. The idea seemed