}
String internalName = null;
for (int i = 0; i < embedFontInfoList.size(); i++) {
EmbedFontInfo configFontInfo = (EmbedFontInfo) embedFontInfoList.get(i);
String fontFile = configFontInfo.getEmbedFile();
internalName = "F" + num;
num++;
try {
FontMetricsMapper font = null;
String metricsUrl = configFontInfo.getMetricsFile();
// If the user specified an XML-based metrics file, we'll use it
// Otherwise, calculate metrics directly from the font file.
if (metricsUrl != null) {
LazyFont fontMetrics = new LazyFont(configFontInfo, fontResolver);
Source fontSource = fontResolver.resolve(configFontInfo.getEmbedFile());
font = new CustomFontMetricsMapper(fontMetrics, fontSource);
} else {
CustomFont fontMetrics = FontLoader.loadFont(
fontFile, null, true, configFontInfo.getEmbeddingMode(),
EncodingMode.AUTO,
configFontInfo.getKerning(),
configFontInfo.getAdvanced(), fontResolver);
font = new CustomFontMetricsMapper(fontMetrics);
}
fontInfo.addMetrics(internalName, font);
List<FontTriplet> triplets = configFontInfo.getFontTriplets();
for (int c = 0; c < triplets.size(); c++) {
FontTriplet triplet = (FontTriplet) triplets.get(c);
if (log.isDebugEnabled()) {
log.debug("Registering: " + triplet + " under " + internalName);