How to know the number of characters we can place in a line ?
Suppose u make some pattern & it looks fine in your device (because width of pattern is less than width of device)
But in other device, it might not get fitted (because it have little less characters capacity per line)
So if there will be someway to identify the no. of characters we can put in a line for different devices, then it will easy to give instruction for maintaining pattern. //ie, we can find maximum width we can have for pattern for a device.
Some function available for that ?
You maybe finding the solution for java.
I have a trick for it - not implemented though.
Get the device width
Measure the approximate length for a character - you may use a ruler 📏😁
Divide the width by approx. length of char and maximum length of a char sequence can be obtained.
But this cannot be done practically in SL as it doesn't support java.awt, as we all know
⏩ Prometheus ⏪
We can do error & trial for a particular device , but cannot do for all device.
//the idea of this I get from Ace sir answer here (see 1st point)
Gaurav Agrawal I think the Apache libraries had some word wrapping libraries but those have been depreciated for some time now.
Your best bet is to look for a word-wrapping library so you won't have to do all the work from scratch.
HonFu Not PC though😀
Gaurav Agrawal Once I had read some article exactly how to do this in various language. Now problem is neither I know Java was amongst them or not nor I remember where is the article.