Font font = (Font)attributes.get(TextAttribute.FONT);
if (font != null) {
if (attributes.size() > 1) { // oh well, check for anything else
AttributeValues values = font.getAttributeValues().clone();
values.merge(attributes, SECONDARY_MASK);
return new Font(values, font.name, font.style,
font.createdFont, font.font2DHandle);
}
return font;