Class TTFSubsetter

java.lang.Object
org.apache.fontbox.ttf.TTFSubsetter

public final class TTFSubsetter extends Object
Subsetter for TrueType (TTF) fonts.

Originally developed by Wolfgang Glas for Sketch.

  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
    • PAD_BUF

      private static final byte[] PAD_BUF
    • TIMEZONE_UTC

      private static final TimeZone TIMEZONE_UTC
    • ttf

      private final TrueTypeFont ttf
    • unicodeCmap

      private final CmapLookup unicodeCmap
    • uniToGID

      private final SortedMap<Integer,Integer> uniToGID
    • keepTables

      private final List<String> keepTables
    • glyphIds

      private final SortedSet<Integer> glyphIds
    • prefix

      private String prefix
    • hasAddedCompoundReferences

      private boolean hasAddedCompoundReferences
  • Constructor Details

    • TTFSubsetter

      public TTFSubsetter(TrueTypeFont ttf) throws IOException
      Creates a subsetter for the given font.
      Parameters:
      ttf - the font to be subset
      Throws:
      IOException - if there is an error reading the font data
    • TTFSubsetter

      public TTFSubsetter(TrueTypeFont ttf, List<String> tables) throws IOException
      Creates a subsetter for the given font.
      Parameters:
      ttf - the font to be subset
      tables - optional tables to keep if present
      Throws:
      IOException - if there is an error reading the font data
  • Method Details