FontSize size = (FontSize) a.getAttribute(CSS.Attribute.FONT_SIZE); int realSize = 12; if (size != null) realSize = size.getValue();
int realSize = getFontSize(a);
  public Font getFont(AttributeSet a)  {    FontSize size = (FontSize) a.getAttribute(CSS.Attribute.FONT_SIZE);    int realSize = 12;    if (size != null)      realSize = size.getValue();    // Decrement size for subscript and superscript.    Object valign = a.getAttribute(CSS.Attribute.VERTICAL_ALIGN);    if (valign != null)      {        String v = valign.toString();        if (v.contains("sup") || v.contains("sub"))          realSize -= 2;      }    // TODO: Convert font family.    String family = "SansSerif";    int style = Font.PLAIN;    FontWeight weight = (FontWeight) a.getAttribute(CSS.Attribute.FONT_WEIGHT);    if (weight != null)      style |= weight.getValue();    FontStyle fStyle = (FontStyle) a.getAttribute(CSS.Attribute.FONT_STYLE);    if (fStyle != null)      style |= fStyle.getValue();    return new Font(family, style, realSize);  }