Class TrueTypeCollection

java.lang.Object
org.apache.fontbox.ttf.TrueTypeCollection
All Implemented Interfaces:
Closeable, AutoCloseable

public class TrueTypeCollection extends Object implements Closeable
A TrueType Collection, now more properly known as a "Font Collection" as it may contain either TrueType or OpenType fonts.
  • Field Details

    • stream

      private final TTFDataStream stream
    • numFonts

      private final int numFonts
    • fontOffsets

      private final long[] fontOffsets
  • Constructor Details

    • TrueTypeCollection

      public TrueTypeCollection(File file) throws IOException
      Creates a new TrueTypeCollection from a .ttc file.
      Parameters:
      file - The TTC file.
      Throws:
      IOException - If the font could not be parsed.
    • TrueTypeCollection

      public TrueTypeCollection(InputStream stream) throws IOException
      Creates a new TrueTypeCollection from a .ttc input stream.
      Parameters:
      stream - A TTC input stream.
      Throws:
      IOException - If the font could not be parsed.
    • TrueTypeCollection

      TrueTypeCollection(TTFDataStream stream) throws IOException
      Creates a new TrueTypeCollection from a TTC stream.
      Parameters:
      stream - The TTF file.
      Throws:
      IOException - If the font could not be parsed.
  • Method Details