Parse font of given text
Maybe I'm being dense, but I don't see an obvious way to map fonts onto the text they apply to. I see the fonts method, but it seems to just list the fonts found on the page, but not what parts of the page they come from? Am I missing something?
From looking at the code, that looks to be correct.
The text is put into TextRun objects within a PageLayout, but these are only initialized with and store x, y, width, font_size and the text. Additionally, when you ask for the page text it merges the TextRuns together into a single text string, so you don't see them individually in any case. It would be possible to associate the fonts with each text segment, but only if you modify the gem code.