Optimising the layout of text for readability, still centres on the spacing of fixed-shape letters along a line (kerning)…a hangover from the days of lead typefaces.
Today’s invention is to ignore the fixed shapes of characters in a typeface.
After each space is typed, the letters in the preceding word undergo a ‘squirming’ process, like the self-organisation which soldiers on parade perform when they are ordered eg to ‘dress right.’ They look at their neighbours and attempt to form a locally straight line (so that a globally-straight rank emerges).
Each character would have its components slightly shifted (on-screen) so as to boost the contrast of the word it’s in.
There is no algorithm for guaranteeing optimality, but in practice, printed components would be alternately thickened and separated (in at least the vertical and horizontal directions).
Once squirming had produced an improvement in word contrast of say 20%, or a time limit was exceeded, the next word would be squirmed.