package fontbug;

import java.awt.Font;
import java.awt.FontFormatException;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

public class FontBug {
    public static void main( String[] args ) throws FontFormatException, IOException {
        BufferedImage img = new BufferedImage( 100, 100, BufferedImage.TYPE_INT_RGB );
        Graphics2D g = img.createGraphics();
        g.setFont( Font.createFont( Font.TRUETYPE_FONT, new File("AdobeMingStd-Light.otf") ).deriveFont( 18f ) );
        int stringWidth = g.getFontMetrics().stringWidth( "Test" );
        System.out.println( "java.version: " + System.getProperty( "java.version" )+" "+System.getProperty("java.runtime.name")+" "+System.getProperty( "os.name" )+" "+System.getProperty( "os.arch" )+" => stringWidth: "+stringWidth );
    }
}
