title: Algorithm for footnote layout with columns
body: <p>I have implemented a basic page layout algorithm for footnote placement. Basically:</p>
  
  <ol>
  <li>Layout a line of body text. </li>
  <li>If it contains footnote references, lay out footnotes line by line.</li>
  <li>Go to 1.</li>
  </ol>
  
  <p>At every step, I check to see if the total height (body text + footnote text + gap) exceeds page height. If it does, I remove the most recently laid out line and the page is complete.</p>
  
  <p>My question is: <strong>How do I deal with a situation where the body text is in two columns?</strong> </p>
  
  <p>I would essentially need to know the total allowed body text height in advance in order to properly lay out the columns, but that cannot be known until I know the height of the footnote text.</p>
  
  <p>I also can't just take the accumulated height of body text lines and divide by 2, due to varying line heights, line spacing, paragraph spacing, etc.</p>