public static FontDesignMetrics metricsCache[] = new FontDesignMetrics[5];
public synchronized static FontMetrics
makeFontMetrics(Font font, FontRenderContext frc)
{
FontDesignMetrics fdm = null;
int i;
for (i = 0; i < metricsCache.length; ++i) {
FontDesignMetrics tfdm = metricsCache[i];
if (tfdm == null) {
break;
}
if (tfdm.getFont().equals(font) && tfdm.getFRC().equals(frc)) {
fdm = tfdm;
break;
}
}
if (fdm == null) {
fdm = new FontDesignMetrics(font, frc);
if (i == metricsCache.length) {
--i;
}
}
if (i > 0) {