registerPlatformFontsUsedByFontConfiguration();
CompositeFontDescriptor[] compositeFontInfo
= fontConfig.get2DCompositeFontInfo();
for (int i = 0; i < compositeFontInfo.length; i++) {
CompositeFontDescriptor descriptor = compositeFontInfo[i];
String[] componentFileNames = descriptor.getComponentFileNames();
String[] componentFaceNames = descriptor.getComponentFaceNames();
/* It would be better eventually to handle this in the
* FontConfiguration code which should also remove duplicate slots
*/
if (missingFontFiles != null) {
for (int ii=0; ii<componentFileNames.length; ii++) {
if (missingFontFiles.contains(componentFileNames[ii])) {
componentFileNames[ii] = getDefaultFontFile();
componentFaceNames[ii] = getDefaultFontFaceName();
}
}
}
/* FontConfiguration needs to convey how many fonts it has added
* as fallback component fonts which should not affect metrics.
* The core component count will be the number of metrics slots.
* This does not preclude other mechanisms for adding
* fall back component fonts to the composite.
*/
if (altNameCache != null) {
FontManager.registerCompositeFont(
descriptor.getFaceName(),
componentFileNames, componentFaceNames,
descriptor.getCoreComponentCount(),
descriptor.getExclusionRanges(),
descriptor.getExclusionRangeLimits(),
true,
altNameCache);
} else {
FontManager.registerCompositeFont(
descriptor.getFaceName(),
componentFileNames, componentFaceNames,
descriptor.getCoreComponentCount(),
descriptor.getExclusionRanges(),
descriptor.getExclusionRangeLimits(),
true);
}
if (debugFonts) {
logger.info("registered " + descriptor.getFaceName());
}
}
}