Closed tuncaulubilge closed 6 years ago
@tuncaulubilge thanks. I will check it. (I want to keep iOS compatibility on this)
What's the plans for iOS compatibility? I'm not an expert in iOS but I'm happy to help to ensure compatibility. This looks like a useful approach for iOS: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TextLayout/Tasks/CountLines.html
@tuncaulubilge thanks, I already have the code for iOS but not time to testing yet. I will include bottom and right info for the end line and update the sample app. (I also tried to include ellipsis information, but without rendering the text on Android it is complicated)
Hope publish the new version before this weekend.
Great library, really saved our lives. Thanks!
We have a specific use case where we need to measure how many words can fit in a certain textbox within a max amount of lines. This is especially useful if you want to simulate inline images and text wraps, where you need to split the text into multiple textboxes around the image.
This PR introduces a new prop to the measure method, called
lineEndForLineNo
, and returns the number of characters that can fit into those lines. This utilizes Android Layout'sgetLineVisibleEnd
method.