Class FontFactory


  • public final class FontFactory
    extends java.lang.Object
    Creates font objects for naked cff fonts
    • Constructor Summary

      Constructors 
      Constructor Description
      FontFactory()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getNumBytesNeededToIdentify()  
      static boolean isCFF​(byte[] startingBytes)
      This is a very loose check to see if the font looks like CFF.
      static CFFFont[] load​(FontByteArray buffer)
      Given buffer of font data, creates cff FontData objects that represent it.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.