Top Description Inners Fields Constructors Methods
org.apache.fontbox.cff

public Class CFFParser

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.charset.StandardCharsets, java.util.ArrayList, .Arrays, .HashMap, .LinkedHashMap, .LinkedList, .List, .Map, org.apache.commons.logging.Log, .LogFactory, org.apache.fontbox.ttf.FontHeaders, org.apache.pdfbox.io.RandomAccessRead

This class represents a parser for a CFF font.
Author
Villu Ruusmann

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
CFFParser.ByteSource

Source from which bytes may be read in the future.

pack-priv abstract static class
CFFParser.CFFBuiltInEncoding

Inner class representing a font's built-in CFF encoding.

private static class
CFFParser.CFFBytesource

Allows bytes to be re-read later by CFFParser.

private static class
CFFParser.DictData

Inner class holding the DictData of a CFF font.

private static class
CFFParser.EmptyCharsetCID

An empty charset in a malformed CID font.

private static class
CFFParser.EmptyCharsetType1

An empty charset in a malformed Type1 font.

private static class
CFFParser.Format0Charset

Inner class representing a Format0 charset.

private static class
CFFParser.Format0Encoding

Inner class representing a Format0 encoding.

private static class
CFFParser.Format0FDSelect

Format 0 FDSelect.

private static class
CFFParser.Format1Charset

Inner class representing a Format1 charset.

private static class
CFFParser.Format1Encoding

Inner class representing a Format1 encoding.

private static class
CFFParser.Format2Charset

Inner class representing a Format2 charset.

private static class
CFFParser.Format3FDSelect

Format 3 FDSelect data.

private static class
CFFParser.Header

Inner class holding the header of a CFF font.

private static class
CFFParser.Range3

Structure of a Range3 element.

private static class
CFFParser.RangeMapping

Inner class representing a rang mapping for a CID charset.

Field Summary

Modifier and TypeField and Description
private String
private static final Log
LOG

Log instance.

private CFFParser.ByteSource
private String[]
private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
concatenateMatrix(List<Number> matrixDest, List<Number> matrixConcat)

private DataInput
private String
public List<CFFFont>

Returns:

the parsed CFF fonts
parse
(byte[]
source bytes
bytes
,
CFFParser.ByteSource
source to re-read bytes from in the future
source
)

Parse CFF font using byte array, also passing in a byte source for future use.

public List<CFFFont>

Returns:

the parsed CFF fonts
parse
(RandomAccessRead
the source to be parsed
randomAccessRead
)

Parse CFF font using a RandomAccessRead as input.

private List<CFFFont>
parse(DataInput
the source to be parsed
input
)

Parse CFF font using a DataInput as input.

private void
parseCIDFontDicts(DataInput input, CFFParser.DictData topDict, CFFCIDFont font, int nrOfcharStrings)

Parse dictionaries specific to a CIDFont.

public void
parseFirstSubFontROS(RandomAccessRead
the source to be parsed
randomAccessRead
,
FontHeaders
where to put results
outHeaders
)

Extract "Registry", "Ordering" and "Supplement" properties from the first CFF subfont.

private CFFFont
parseFont(DataInput input, String name, byte[] topDictIndex)

private CFFCIDFont
parseROS(CFFParser.DictData topDict)

Extracts Registry, Ordering and Supplement from topDict["ROS"].

private void
parseType1Dicts(DataInput input, CFFParser.DictData topDict, CFFType1Font font, CFFCharset charset)

Parse dictionaries specific to a Type 1-equivalent font.

private CFFCharset
readCharset(DataInput dataInput, int nGlyphs, boolean isCIDFont)

private static CFFParser.DictData
private static CFFParser.DictData
readDictData(DataInput input, int offset, int dictSize)

private CFFEncoding
readEncoding(DataInput dataInput, CFFCharset charset)

private static CFFParser.DictData.Entry
private static FDSelect

Returns:

the FDSelect data
readFDSelect
(DataInput dataInput, int nGlyphs)

Read the FDSelect Data according to the format.

private CFFParser.Format0Charset
readFormat0Charset(DataInput dataInput, int nGlyphs, boolean isCIDFont)

private CFFParser.Format0Encoding
readFormat0Encoding(DataInput dataInput, CFFCharset charset, int format)

private static CFFParser.Format0FDSelect

Returns:

the Format 0 of the FDSelect data
readFormat0FDSelect
(DataInput dataInput, int nGlyphs)

Read the Format 0 of the FDSelect data structure.

private CFFParser.Format1Charset
readFormat1Charset(DataInput dataInput, int nGlyphs, boolean isCIDFont)

private CFFParser.Format1Encoding
readFormat1Encoding(DataInput dataInput, CFFCharset charset, int format)

private CFFParser.Format2Charset
readFormat2Charset(DataInput dataInput, int nGlyphs, boolean isCIDFont)

private static CFFParser.Format3FDSelect

Returns:

the Format 3 of the FDSelect data
readFormat3FDSelect
(DataInput dataInput)

Read the Format 3 of the FDSelect data structure.

private static CFFParser.Header
private static byte[][]
private static int[]
private static Integer
private static long
private static int
private static String
readOperator(DataInput input, int b0)

private Map<String, Object>
private static Double
private String
readString(int index)

private static String[]
private void
private static String
private DataInput
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait