@@ -0,0 +1,569 @@
+/**%0A * %0A */%0Apackage mathsquared.resultswizard2;%0A%0Aimport java.awt.Font;%0Aimport java.awt.FontMetrics;%0Aimport java.awt.Graphics;%0A%0A/**%0A * Contains utility methods for working with fonts.%0A * %0A * @author MathSquared%0A * %0A */%0Apublic class FontUtils %7B%0A    public Font shrinkFontForWidth (Font base, String text, int desiredWidth, Graphics getMetrics) %7B%0A        FontMetrics metrics = getMetrics.getFontMetrics(base);%0A        while (metrics.stringWidth(text) %3E desiredWidth) %7B%0A            base = base.deriveFont((float) base.getSize() - 1);%0A        %7D%0A        return base;%0A    %7D%0A%7D%0A

Add FontUtils and shrinkFontForWidth