File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issue with stringWidth() method of FontMetrics class

Adwait Patankar
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

We have an application supporting different languages.
In order to set the bounds of the tooltip, we require is to calculate the width based on the width of the string.

I'm doing the following :
FontMetrics fm = getFontMetrics(this.cellFont);
int width = fm.stringWidth(tip);

Issue is : length of the string and Font remaining same, if any accented character appears in the string, width returned is same. But while actual display of accented characters it is taking more space.
Hence my strings are getting cut when shown in the tooltip.

Is there any known issue for stringWidth() method of FontMetrics?
I agree. Here's the link:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic