@Override public byte[] getFontFile() { if (this.pfb != null) { return pfb.getPfbData(); } else { return this.parsePfb(); } }
/** * Starts parsing the pfb file if it hasn't been parsed already. * * @return byte array containing the parsed file. Will be an empty array if the file could not be * found. */ private byte[] parsePfb() { InputStream file; try { file = getFile(".pfb"); } catch (FileNotFoundException e) { LOGGER.info( "Could not find Pfb file for {}, will continue without embedding Pfb data.", filename); return new byte[0]; } pfb = new PfbParser(file); return pfb.getPfbData(); }
@Override public int[] getFontProgramLengths() { return pfb.getLengths(); }