Enumeration e = fonts.keys();
PDFResources resources = doc.getResources();
while (e.hasMoreElements()) {
String f = (String)e.nextElement();
Font font = (Font)fonts.get(f);
FontDescriptor desc = null;
if (font instanceof FontDescriptor) {
desc = (FontDescriptor)font;
}
resources.addFont(doc.makeFont(f, font.fontName(),
font.encoding(), font, desc));