scale Font - Java 2D Graphics

Java examples for 2D Graphics:Font

Description

scale Font

Demo Code


//package com.java2s;
import java.awt.Font;

public class Main {
    private static Font scale(Font font, double factor) {
        int newSize = Math.round((float) (font.getSize() * factor));
        return font.deriveFont((float) newSize);
    }//from w w w.jav a 2 s  . c o  m
}

Related Tutorials