font = PDFFont.createFont(fontname, fonttype, subsetFontName, null);
getDocument().registerObject(font);
if (fonttype == FontType.TYPE0) {
font.setEncoding(encoding);
CIDFont cidMetrics;
if (metrics instanceof LazyFont) {
cidMetrics = (CIDFont)((LazyFont) metrics).getRealFont();
} else {
cidMetrics = (CIDFont)metrics;
}
PDFCIDSystemInfo sysInfo
= new PDFCIDSystemInfo(cidMetrics.getRegistry(),
cidMetrics.getOrdering(),
cidMetrics.getSupplement());
PDFCIDFont cidFont = new PDFCIDFont(subsetFontName,
cidMetrics.getCIDType(),
cidMetrics.getDefaultWidth(),
getSubsetWidths(cidMetrics), sysInfo,
(PDFCIDFontDescriptor)pdfdesc);
getDocument().registerObject(cidFont);
PDFCMap cmap = new PDFToUnicodeCMap(
cidMetrics.getCIDSubset().getSubsetChars(),
"fop-ucs-H",
new PDFCIDSystemInfo("Adobe",
"Identity",
0), false);
getDocument().registerObject(cmap);