From 70e8d132b0c87e9a701206ceafed1cbc84d9b9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 20 Feb 2021 10:07:44 +0100 Subject: [PATCH] gnujpdf code clean --- .../gnujpdf/src/gnu/jpdf/PDFEmbeddedFont.java | 31 ++----------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/libsrc/gnujpdf/src/gnu/jpdf/PDFEmbeddedFont.java b/libsrc/gnujpdf/src/gnu/jpdf/PDFEmbeddedFont.java index f6184559d..ef4430e7e 100644 --- a/libsrc/gnujpdf/src/gnu/jpdf/PDFEmbeddedFont.java +++ b/libsrc/gnujpdf/src/gnu/jpdf/PDFEmbeddedFont.java @@ -9,9 +9,8 @@ import java.io.OutputStream; */ public class PDFEmbeddedFont extends PDFFont { - private String name; - private String font; - private String type; + private final String name; + private final String font; private final String descendantFont; private final String toUnicode; @@ -19,45 +18,19 @@ public class PDFEmbeddedFont extends PDFFont { super(name, "/TrueType", font, style); this.name = name; this.font = font; - this.type = "/TrueType"; this.descendantFont = descendantFont; this.toUnicode = toUnicode; } @Override public void write(OutputStream os) throws IOException { - // Write the object header writeStart(os); - - // now the objects body os.write("/Subtype /Type0\n".getBytes()); os.write(("/BaseFont " + font + "\n").getBytes()); os.write(("/Name " + name + "\n").getBytes()); os.write("/Encoding /Identity-H\n".getBytes()); - //System.err.println("descendantFont=" + descendantFont); os.write(("/ToUnicode " + toUnicode + "\n").getBytes()); os.write(("/DescendantFonts [" + descendantFont + "]\n").getBytes()); - /*int cnt = 300; - - os.write(("/FirstChar 0\n").getBytes()); - os.write(("/LastChar " + (cnt - 1) + "\n").getBytes()); - - os.write(("/Widths [").getBytes()); - for (int i = 0; i < cnt; i++) { - os.write((" " + i).getBytes()); - } - os.write(("]\n").getBytes()); - */ - //os.write("/Widths [500 583 587 796]".getBytes()); - - /*os.write("/FontDescriptor ".getBytes()); - os.write(descriptor.getBytes()); - os.write("\n".getBytes());*/ - - /*os.write("/ToUnicode ".getBytes()); - os.write(toUnicode.getBytes()); - os.write("\n".getBytes());*/ - // finish off with its footer writeEnd(os); }