Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
print: accurately track (fractional) line width, and raise the max wi…
…dth back to 120. (#37) *Originally found/fixed during the #33/#34/#35/#36 series of pretty-printing PRs.* Before this PR, we were treating all text the same, regardless of style, but this PR introduces the concept of "fractional columns" (integer multiples of `0.1ch`, because our `font-size`s are always integer multiples of `0.1em`). The result is much more accurate, and so far appears to perfectly match browser behavior (i.e. the transition of `MAX_LINE_WIDTH` from `N-1` to `N`, where multi-line layout gets replaced with single-line layout, results in a line that "tightly fits" in a `max-width: Nch` container, with no spurious gaps or overflows). Note however that the increased accuracy makes the layout favor HTML over plaintext (and we don't have a plaintext-vs-HTML "simultaneous layout", nor a way to hint what the output of pretty layout will be used for), so the plaintext output may feel more inconsistent as a result (but its aesthetics are of dubious value anyway).
- Loading branch information