Skip navigation
Playing with the Knuth-Plass algorithm and I think it’s an interesting algorithm to visualize!
0:00 / 0:18

Playing with the Knuth-Plass algorithm and I think it’s an interesting algorithm to visualize!

Damar

@damarberlari2.5K followers

Visit on X

173,170 views

Playing with the Knuth-Plass algorithm and I think it’s an interesting algorithm to visualize! Might write a complete visual article later, but here’s a quick comparison for now. It looks at the whole paragraph to find the breakpoints that produce the most uniform spacing. So unlike the greedy approach, the layout might shift when a new word is added. Note: I didn’t use pretext here; it’s a monospace font so calculating the word widths is quite easy. will try pretext and try other fonts next

Comments

Comments from the original post on X (Twitter)

No comments yet