How to measure text size? #163
Unanswered
JanDiederich
asked this question in
Q&A
Replies: 2 comments 1 reply
-
|
I think you're probably just missing the glyph offsets. Take a look at the swash draw code at Line 1289 in e16b39f Specifically, you probably want something like this (untested): |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Surprised that text measuring isn't a standalone method in cosmic-text, since it is a very useful feature! Thanks for providing a function. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Since I couldn't find one, I wrote a util function to measure text size:
But this doesn't work, neither
wnorrun_widthare big enough, at the end of the function. They get bigger as the text gets longer, but they are still smaller than the actual text. So I can't center the text.What do I do? How do I measure the actual text size?
Beta Was this translation helpful? Give feedback.
All reactions