I have an XML config that enables auto-detection of system fonts:
<fop version="1.0">
<fonts>
<auto-detect/>
</fonts>
<!-- ... -->
</fop>
And I configure a custom fonts directory programmatically:
// ...
FopConfParser fopConfParser = new FopConfParser(configFileStream, environmentProfile);
FopFactoryBuilder fopFactoryBuilder = fopConfParser.getFopFactoryBuilder()
fopFactoryBuilder.getFontManager().setResourceResolver(ResourceResolverFactory.createDefaultInternalResourceResolver(fontDir.toURI()));
In principle, this works. However, if a font is present in the system fonts directory as well as in my custom directory, the sytem font is used. This seems to be changed behavior from FOP 1.x to 2.x.
Is there a way to genrally prioritize fonts from custom directory over system fonts? I know that this can be solved with embed-url but I ideally don't want to configure this for every font explicitly.