Converting Chapterizer from Cairo + Pango to CapyPDF

Chapterizer (not a great name, I know) is a tool I wrote to generate books. Originally used Cairo and Pango to generate PDF files. It works and was fairly easy to get started but has its own set of downsides: Cairo always produces RGB PDFs, which are not accepted by printing houses Cairo does not handle advanced PDF features like trim boxes Pango aligns text at the top of each line, but for high…