Class TTFSubsetter


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

    Originally developed by Wolfgang Glas for Sketch.

    • Constructor Detail

      • TTFSubsetter

        public TTFSubsetter​(TrueTypeFont ttf)
                     throws IOException
        Creates a subsetter for the given font.
        Parameters:
        ttf - the font to be subset
        Throws:
        IOException
      • 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
    • Method Detail

      • setPrefix

        public void setPrefix​(String prefix)
        Sets the prefix to add to the font's PostScript name.
      • add

        public void add​(int unicode)
        Add the given character code to the subset.
        Parameters:
        unicode - character code
      • addAll

        public void addAll​(Set<Integer> unicodeSet)
        Add the given character codes to the subset.
        Parameters:
        unicodeSet - character code set