Repository navigation
Text width and height based on number of characters / lines displayed #1201
Unanswered
vikigenius
asked this question in
Q&A
Replies: 1 comment 2 replies
|
To make advanced text-related widgets and complex UI, it is required to have functions able to measure text metrics such as character width and height of individual characters, especially when CJK characters and emoji sequences are involved. Unfortunately, it is not available now. If it is complicated to implement, please at least expose some low-level API calls so that we could try to implement ourselves. |
2 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.
So I am trying to develop a card like item that contains long texts, that can be expanded on a button click.
Currently I limit the size of the card by fixing the number of characters I display. (Can just take a slice). Then on button click I just change the text.
But what if I want to fix the number of lines that I want to display? Say I want to display the first 4 lines?
Equivalently, how do I determine the number of characters that will fit in a single line given width and height of the text element? Is this possible?
All reactions