Package com.adobe.fontengine.font.cff
Class FontFactory
- java.lang.Object
-
- com.adobe.fontengine.font.cff.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.
-
-
-
Method Detail
-
load
public static CFFFont[] load(FontByteArray buffer) throws java.io.IOException, InvalidFontException, UnsupportedFontException
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:
java.io.IOException
- Thrown if the stream cannot be readInvalidFontException
- 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.
-
-