Replies: 1 comment 2 replies
-
Have you tried the master branch? I remember seeing similar reports before and there is a change (73be039) that affects the width of text. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to figure out the width a piece of text so I can do some layout before positioning the text. The text includes words and symbols, and I need to use multiple fonts to cover all the needed glyphs. The fallback fonts mechanism works very well for that. However I'm having trouble figuring out how to determine the width of the text.
Document has width_of, which is giving me the wrong width. Looking at the code for width_of, it doesn't appear to take fallback fonts into consideration.
Best I can tell, the only place that knows about fallback fonts is Prawn::Text::Formatted::Box, which I can create, and render with dry_run: true. But there doesn't appear to be any way for me to get the width of text inside the box after that.
Is there someway to get the width of a piece of text with fallback fonts that I've missed? I'm using the latest version, 2.4.0. Thank you for any help,
Beta Was this translation helpful? Give feedback.
All reactions