Measuring the bounds of text
See original GitHub issueHow can I measure text bounds using this library?
Skia has SKPaint.MeasureText, but I am unable to find an equivalent in this library.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Accurate Measurements With getTextBounds()
Retrieve the text boundary box and store to bounds. Return in bounds (allocated by the caller) the smallest rectangle that encloses all of...
Read more >Measuring Text - The Java™ Tutorials
stringWidth() returns the advance width of the text. Advance width is the distance from the origin of the text to the position of...
Read more >Measuring tight bounds box of multiline text - android
I'm drawing a multiline text on a canvas using StaticLayout , and I want to measure the most tight bounds box around the...
Read more >Text pixel width measuring on Javascript backend (Node.Js)
Recently I needed a library in Javascript for measuring text pixel width in Node.Js. The usage was in backend web scraper that is...
Read more >Measuring Text - Chris Banes
As you can see, the text clearly draws outside of it's calculated bounds, both in height and width. Another text measuring method #....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@swharden Interesting - I think your sample highlights two different things:
pdrop below it.This looks about right:
Commas and periods are undercalculated:

Exclamation marks are overcalculated:
This method doesn’t take multiple lines under consideration. There is:
while it should somehow count text lines and spaces between them.