Skip to content

Commit 95ce874

Browse files
committed
PDFBOX-5660: improve code, as suggested by Andreas Lehmkühler
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1928961 13f79535-47bb-0310-9956-ffa450edef68
1 parent 5de9d86 commit 95ce874

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import java.io.IOException;
2424
import java.io.InputStream;
2525
import java.nio.charset.StandardCharsets;
26-
import java.util.ArrayList;
26+
import java.util.Arrays;
2727
import java.util.HashSet;
2828
import java.util.List;
2929
import java.util.Map;
@@ -55,22 +55,10 @@ abstract class TrueTypeEmbedder implements Subsetter
5555
private static final String BASE25 = "BCDEFGHIJKLMNOPQRSTUVWXYZ";
5656

5757
// PDF spec required tables (if present), all others will be removed
58-
private static final List<String> TABLES = new ArrayList<>(10);
59-
60-
static
61-
{
62-
TABLES.add("head");
63-
TABLES.add("hhea");
64-
TABLES.add("loca");
65-
TABLES.add("maxp");
66-
TABLES.add("cvt ");
67-
TABLES.add("prep");
68-
TABLES.add("glyf");
69-
TABLES.add("hmtx");
70-
TABLES.add("fpgm");
71-
// Windows ClearType
72-
TABLES.add("gasp");
73-
}
58+
private static final List<String> TABLES =
59+
Arrays.asList("head", "hhea", "loca", "maxp", "cvt ", "prep", "glyf", "hmtx", "fpgm",
60+
// Windows ClearType
61+
"gasp");
7462

7563
private final PDDocument document;
7664
protected TrueTypeFont ttf;

0 commit comments

Comments
 (0)