@SuppressWarnings("deprecation") void sync(GlyphView v) { Font f = v.getFont(); if ((metrics == null) || (!f.equals(metrics.getFont()))) { // fetch a new FontMetrics Container c = v.getContainer(); metrics = (c != null) ? c.getFontMetrics(f) : Toolkit.getDefaultToolkit().getFontMetrics(f); } }