public boolean matches(String fontFile) {
return fontFile.toLowerCase().endsWith(".pfm");
}
public void transform(String fontFile) throws IOException {
PFMReader reader = new PFMReader();
getLog().debug("Parsing font: " + fontFile);
PFMFile pfm = reader.loadPFM(fontFile);
if (pfm == null) {
throw new IOException("Unable to load PFM file: " + fontFile);
}
Document doc = reader.constructFontXML(pfm, null, null, null, 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);
}
}