protected Type1Font(String metricsPath, String binaryPath, byte[] afm, byte[] pfb) throws java.io.IOException { this(); fontParser = new Type1Parser(metricsPath, binaryPath, afm, pfb); process(); }
public boolean isBuiltWith(String fontProgram) { return Objects.equals(fontParser.getAfmPath(), fontProgram); }
public boolean isBuiltInFont() { return fontParser != null && fontParser.isBuiltInFont(); }
public byte[] getFontStreamBytes() { if (fontParser.isBuiltInFont()) return null; if (fontStreamBytes != null) RandomAccessFileOrArray raf = null; try { raf = fontParser.getPostscriptBinary(); int fileLength = (int) raf.length(); fontStreamBytes = new byte[fileLength - 18];
protected void process() throws java.io.IOException { RandomAccessFileOrArray raf = fontParser.getMetricsFile(); String line; boolean startKernPairs = false; String metricsPath = fontParser.getAfmPath(); if (metricsPath != null) { throw new IOException("startcharmetrics is missing in {0}.").setMessageParams(metricsPath); String metricsPath = fontParser.getAfmPath(); if (metricsPath != null) { throw new IOException("endcharmetrics is missing in {0}.").setMessageParams(metricsPath); String metricsPath = fontParser.getAfmPath(); if (metricsPath != null) { throw new IOException("endfontmetrics is missing in {0}.").setMessageParams(metricsPath); String metricsPath = fontParser.getAfmPath(); if (metricsPath != null) { throw new IOException("endkernpairs is missing in {0}.").setMessageParams(metricsPath);
if (isAfmFile(rf)) { return rf; } else {
public byte[] getFontStreamBytes() { if (fontParser.isBuiltInFont()) return null; if (fontStreamBytes != null) RandomAccessFileOrArray raf = null; try { raf = fontParser.getPostscriptBinary(); int fileLength = (int) raf.length(); fontStreamBytes = new byte[fileLength - 18];
protected void process() throws java.io.IOException { RandomAccessFileOrArray raf = fontParser.getMetricsFile(); String line; boolean startKernPairs = false; String metricsPath = fontParser.getAfmPath(); if (metricsPath != null) { throw new IOException("startcharmetrics is missing in {0}.").setMessageParams(metricsPath); String metricsPath = fontParser.getAfmPath(); if (metricsPath != null) { throw new IOException("endcharmetrics is missing in {0}.").setMessageParams(metricsPath); String metricsPath = fontParser.getAfmPath(); if (metricsPath != null) { throw new IOException("endfontmetrics is missing in {0}.").setMessageParams(metricsPath); String metricsPath = fontParser.getAfmPath(); if (metricsPath != null) { throw new IOException("endkernpairs is missing in {0}.").setMessageParams(metricsPath);
if (isAfmFile(rf)) { return rf; } else {
protected Type1Font(String metricsPath, String binaryPath, byte[] afm, byte[] pfb) throws java.io.IOException { this(); fontParser = new Type1Parser(metricsPath, binaryPath, afm, pfb); process(); }
public boolean isBuiltWith(String fontProgram) { return Objects.equals(fontParser.getAfmPath(), fontProgram); }
public boolean isBuiltInFont() { return fontParser != null && fontParser.isBuiltInFont(); }