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

public Class Type1CharStringParser

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.ArrayDeque, .ArrayList, .Deque, .List, org.apache.commons.logging.Log, .LogFactory, org.apache.fontbox.cff.CharStringCommand.Type1KeyWord

This class represents a converter for a mapping into a Type 1 sequence.
Authors
Villu Ruusmann, John Hewson
See Also
Adobe Type 1 Font Format, Adobe Systems (1999)

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
Type1CharStringParser(String
font name
fontName
)

Constructs a new Type1CharStringParser object.

Method Summary

Modifier and TypeMethod and Description
public List<Object>

Returns:

the Type1 sequence
parse
(byte[]
the given mapping as byte array
bytes
,
List<byte[]>
list of local subroutines
subrs
,
String
name of the current glyph
glyphName
)

The given byte array will be parsed and converted to a Type1 sequence.

private List<Object>
parse(byte[] bytes, List<byte[]> subrs, List<Object> sequence)

private void
private void
processCallSubr(List<byte[]> subrs, List<Object> sequence)

private CharStringCommand
readCommand(DataInput input, int b0)

private Integer
readNumber(DataInput input, int b0)

private static Integer
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CALLOTHERSUBRback to summary
private static final int CALLOTHERSUBR
CALLSUBRback to summary
private static final int CALLSUBR
currentGlyphback to summary
private String currentGlyph
fontNameback to summary
private final String fontName
LOGback to summary
private static final Log LOG
POPback to summary
private static final int POP
TWO_BYTEback to summary
private static final int TWO_BYTE

Constructor Detail

Type1CharStringParserback to summary
public Type1CharStringParser(String fontName)

Constructs a new Type1CharStringParser object.

Parameters
fontName:String

font name

Method Detail

parseback to summary
public List<Object> parse(byte[] bytes, List<byte[]> subrs, String glyphName) throws IOException

The given byte array will be parsed and converted to a Type1 sequence.

Parameters
bytes:byte[]

the given mapping as byte array

subrs:List<byte[]>

list of local subroutines

glyphName:String

name of the current glyph

Returns:List<Object>

the Type1 sequence

Exceptions
IOException:
if an error occurs during reading
parseback to summary
private List<Object> parse(byte[] bytes, List<byte[]> subrs, List<Object> sequence) throws IOException
processCallOtherSubrback to summary
private void processCallOtherSubr(DataInput input, List<Object> sequence) throws IOException
processCallSubrback to summary
private void processCallSubr(List<byte[]> subrs, List<Object> sequence) throws IOException
readCommandback to summary
private CharStringCommand readCommand(DataInput input, int b0) throws IOException
readNumberback to summary
private Integer readNumber(DataInput input, int b0) throws IOException
removeIntegerback to summary
private static Integer removeInteger(List<Object> sequence) throws IOException