List of usage examples for com.lowagie.text FontFactory registerDirectory
public static int registerDirectory(String dir, boolean scanSubdirectories)
From source file:org.mapfish.print.MapPrinter.java
License:Open Source License
/** * Register the user specified fonts in iText. *///from w w w.j ava 2s. com private void initFonts() { //we don't do that since it takes ages and that would hurt the perfs for //the python controller: //FontFactory.registerDirectories(); FontFactory.defaultEmbedding = true; final TreeSet<String> fontPaths = config.getFonts(); if (fontPaths != null) { for (String fontPath : fontPaths) { fontPath = fontPath.replaceAll("\\$\\{configDir\\}", configDir); File fontFile = new File(fontPath); if (fontFile.isDirectory()) { FontFactory.registerDirectory(fontPath, true); } else { FontFactory.register(fontPath); } } } }