public boolean isCff() { return fontParser.isCff(); }
public boolean isCff() { return fontParser.isCff(); }
public byte[] getFontStreamBytes() { if (fontStreamBytes != null) return fontStreamBytes; try { if (fontParser.isCff()) { fontStreamBytes = fontParser.readCffFont(); } else { fontStreamBytes = fontParser.getFullFont(); } } catch (java.io.IOException e) { fontStreamBytes = null; throw new IOException(IOException.IoException, e); } return fontStreamBytes; }
public byte[] getFontStreamBytes() { if (fontStreamBytes != null) return fontStreamBytes; try { if (fontParser.isCff()) { fontStreamBytes = fontParser.readCffFont(); } else { fontStreamBytes = fontParser.getFullFont(); } } catch (java.io.IOException e) { fontStreamBytes = null; throw new IOException(IOException.IoException, e); } return fontStreamBytes; }
/** * If this font file is using the Compact Font File Format, then this method * will return the raw bytes needed for the font stream. If this method is * ever made public: make sure to add a test if (cff == true). * * @return a byte array */ public byte[] readCffFont() throws java.io.IOException { if (!isCff()) { return null; } RandomAccessFileOrArray rf2 = null; try { rf2 = raf.createView(); rf2.seek(cffOffset); byte[] cff = new byte[cffLength]; rf2.readFully(cff); return cff; } finally { try { if (rf2 != null) { rf2.close(); } } catch (Exception ignored) { } } }
/** * If this font file is using the Compact Font File Format, then this method * will return the raw bytes needed for the font stream. If this method is * ever made public: make sure to add a test if (cff == true). * * @return a byte array */ public byte[] readCffFont() throws java.io.IOException { if (!isCff()) { return null; } RandomAccessFileOrArray rf2 = null; try { rf2 = raf.createView(); rf2.seek(cffOffset); byte[] cff = new byte[cffLength]; rf2.readFully(cff); return cff; } finally { try { if (rf2 != null) { rf2.close(); } } catch (Exception ignored) { } } }