stronk-dev/Guitar-Sheet-Parser

Dynamically resize font sizes of sections to fit pages better

Closed this issue · 1 comments

We want to fill up the available space as much as possible, as well as keep whole blocks of tablature on the same page
Sometimes, this results in single sections on a third page, for example.

We can stop this by re-rendering the file or a few sections with slightly smaller font sizes until t can fit on less pages that way

We might want to add a pre-render function which calculates the sizes of all sections for a set of font sizes and then recommends the font size which results in the fewest amount of pages, while being as large as possible
(if there is free space, we can increase font size for specific sections)
(check all pages: shrink font size to fit the section on the next page, if it is small enough that we might be able to fit it a page earlier)

We might also want to set a function which forces a specific amount of pages

Added a function to resize sections down if it overflows on width
Added simple page prerendering, so all that is left to do is to check the whitespace on each page proportionally to the first section on the next page