// End TTF creation
// Create a WOFF file from this TTF file using sfntly
FontFactory fontFactory = FontFactory.getInstance();
File fontFile = new File(getTTFfilename());
File outputFile = new File(WOFFfilename);
byte[] fontBytes = new byte[0];
try {
FileInputStream fis = new FileInputStream(fontFile);
fontBytes = new byte[(int) fontFile.length()];
fis.read(fontBytes);
} catch (IOException e) {
System.out
.println("Error while creating WOFF File. TTF file not found: "
+ getTTFfilename());
e.printStackTrace();
}
Font[] fontArray = null;
try {
fontArray = fontFactory.loadFonts(fontBytes);
} catch (IOException e) {
System.out
.println("Error while creating WOFF File. TTF file could not be read: "
+ getTTFfilename());
e.printStackTrace();