Author: tilman
Date: Sun Oct  5 09:55:23 2025
New Revision: 1928948

Log:
PDFBOX-5660: make it constant, as suggested by Andreas Lehmkühler

Modified:
   
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java

Modified: 
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java
==============================================================================
--- 
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java
       Sun Oct  5 09:53:33 2025        (r1928947)
+++ 
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java
       Sun Oct  5 09:55:23 2025        (r1928948)
@@ -54,6 +54,24 @@ abstract class TrueTypeEmbedder implemen
     private static final int OBLIQUE = 512;
     private static final String BASE25 = "BCDEFGHIJKLMNOPQRSTUVWXYZ";
 
+    // PDF spec required tables (if present), all others will be removed
+    private static final List<String> TABLES = new ArrayList<>(10);
+
+    static
+    {
+        TABLES.add("head");
+        TABLES.add("hhea");
+        TABLES.add("loca");
+        TABLES.add("maxp");
+        TABLES.add("cvt ");
+        TABLES.add("prep");
+        TABLES.add("glyf");
+        TABLES.add("hmtx");
+        TABLES.add("fpgm");
+        // Windows ClearType
+        TABLES.add("gasp");
+    }
+
     private final PDDocument document;
     protected TrueTypeFont ttf;
     protected PDFontDescriptor fontDescriptor;
@@ -312,22 +330,8 @@ abstract class TrueTypeEmbedder implemen
             throw new IllegalStateException("Subsetting is disabled");
         }
 
-        // PDF spec required tables (if present), all others will be removed
-        List<String> tables = new ArrayList<>(10);
-        tables.add("head");
-        tables.add("hhea");
-        tables.add("loca");
-        tables.add("maxp");
-        tables.add("cvt ");
-        tables.add("prep");
-        tables.add("glyf");
-        tables.add("hmtx");
-        tables.add("fpgm");
-        // Windows ClearType
-        tables.add("gasp");
-
         // set the GIDs to subset
-        TTFSubsetter subsetter = new TTFSubsetter(ttf, tables);
+        TTFSubsetter subsetter = new TTFSubsetter(ttf, TABLES);
         subsetter.addAll(subsetCodePoints);
         subsetter.forceInvisible('\u200B'); // ZWSP
         subsetter.forceInvisible('\u200C'); // ZWNJ

Reply via email to