mbutterick/quad

inner & outer as line-align options

Closed this issue · 2 comments

inner & outer as line-align options

First, notice that this doesn't affect center or justify lines, which are equidistant from the line edges. This only affects lines that we would otherwise call left and right aligned.

One tricky part is that as it stands, line wrapping (and filling) happens before pagination. Meaning, at the moment the line is filled, it doesn't know what page it will be on (and thus can't determine which direction inner and outer will be).

Two possibilities:

  • Brute force followed by fixup. Initially, just fill inner aligned lines as if they were left and outer as if they were right (which will be correct on right-hand pages). Then, once pagination is available, go back to the left-hand pages and switch the alignment of these lines.

  • Defer line-filling altogether until pagination is available. Line filling doesn't affect the layout size of the line, just the appearance of the elements within. Therefore, column and page breaks can be calculated without lines filled.

I went with "brute force" (naturally) but deferring operations is likely a more fruitful way of doing things.