Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse font of given text #272

Open
chrismv48 opened this issue Feb 3, 2018 · 1 comment
Open

Parse font of given text #272

chrismv48 opened this issue Feb 3, 2018 · 1 comment

Comments

@chrismv48
Copy link

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?

@rockorequin
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants