public boolean matches(String fontFile) {
return fontFile.toLowerCase().endsWith(".ttf");
}
public void transform(String fontFile) throws IOException {
TTFReader reader = new TTFReader();
getLog().debug("Parsing font: " + fontFile);
TTFFile ttf = reader.loadTTF(fontFile, null, true, true);
if (ttf == null) {
throw new IOException("Unable to load TTF file: " + fontFile);
}
Document doc = reader.constructFontXML(ttf, null, null, null, null, !ansi, null);
if (doc == null) {
throw new IOException("Unable to construct font XML file");
}
try {
reader.writeFontXML(doc, getTargetFile(fontFile));
} catch (TransformerException e) {
throw new IOException("Unable to write font XML file", e);
}
}