This repo is a light port to Java of anafanafo, which computes text width for 110 pt Verdana. Built with MavenBadges in mind.
final SimpleFontMetrics metrics = SimpleFontMetrics.getInstance();
final int width = metrics.widthOf("Hello World!");
Add dependency to your pom.xml:
<dependency>
<groupId>org.javastack</groupId>
<artifactId>fontmetrics</artifactId>
<version>1.1.0</version>
</dependency>
All rights to Verdana are owned by Microsoft Corp.
The remainder of this project is licensed under the Apache-2.0 License.
Inspired in anafanafo, this code is Java-minimalistic version.