Class FontFactory

java.lang.Object
com.adobe.fontengine.font.cff.FontFactory

public final class FontFactory extends Object
Creates font objects for naked cff fonts
  • Constructor Details

    • FontFactory

      public FontFactory()
  • Method Details

    • load

      Given buffer of font data, creates cff FontData objects that represent it. Note that fonts are parsed at this point.
      Returns:
      An array of cff fonts
      Throws:
      IOException - Thrown if the stream cannot be read
      InvalidFontException - Thrown if the stream does not represent a valid cff font.
      UnsupportedFontException - Thrown if the stream represents an unsupported cff font.
    • getNumBytesNeededToIdentify

      public static int getNumBytesNeededToIdentify()
      Returns:
      the minimum number of bytes needed to try to identify whether a font stream contains cff
    • isCFF

      public static boolean isCFF(byte[] startingBytes)
      This is a very loose check to see if the font looks like CFF. Since these fonts don't have as solid of a way of identifying them as other fonts do, this check should only be used when checks for other fonttypes have failed.
      Parameters:
      startingBytes - bytes from the start of the font stream. Must contain at least getNumBytesNeededToIdentify bytes.
      Returns:
      true of the font appears to be cff. false otherwise.