Class FontFactory


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

      • FontFactory

        public FontFactory()
    • Method Detail

      • 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.