throw new IllegalArgumentException
("This identifier does not belong to the AWT-font system.");
}
// AWT-FontRecords and AWT-FontIdentifiers are implemented in the same class.
final FontRecord record = (FontRecord) identifier;
int style = Font.PLAIN;
if (record.isBold())
{
style |= Font.BOLD;
}
if (record.isItalic())
{
style |= Font.ITALIC;
}
final Font font = new Font(record.getFamily().getFamilyName(), style, (int) context.getFontSize());
return new AWTFontMetrics(font, context);
}