Is there a way to get the string length in twips? java implementation would be good.
You can get the width of a char or String, displayed in a certain font, with FontMetrics.stringWidth(). This should be the size in Points. A point is equal to 20 twips.
So this should work:
Font font = new Font("Arial", Font.PLAIN, 10);
FontMetrics fm = new FontMetrics(font);
int widthInTwips = fm.stringWidth("Hello World") * 20;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With