Package org.apache.fop.fonts.type1
Class Type1SubsetFile
java.lang.Object
org.apache.fop.fonts.type1.Type1SubsetFile
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A class to encode and decode sections of a type 1 font file.static final class
A class used to store the last number operand and also it's size in bytes -
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected List<PostscriptParser.PSElement>
protected static final org.apache.commons.logging.Log
protected List<PostscriptParser.PSElement>
protected boolean
protected boolean
protected LinkedHashMap<Integer,
byte[]> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
createSubset
(InputStream in, SingleByteFont sbfont) protected String
findVariable
(byte[] decoded, List<PostscriptParser.PSElement> elements, String[] matches, String fallback) protected byte[]
getBinaryEntry
(int[] position, byte[] decoded) Returns a section of a byte array determined by it's start and end position.protected PostscriptParser.PSElement
getElement
(String elementID, List<PostscriptParser.PSElement> elements) protected String
getEntryPart
(String entry, int part) searchEntries
(HashMap<Integer, String> encodingEntries, int glyph) byte[]
stitchFont
(ByteArrayOutputStream boasHeader, ByteArrayOutputStream boasMain, ByteArrayOutputStream boasTrailer) protected ByteArrayOutputStream
writeHeader
(PFBData pfbData, PostscriptParser.PSElement encoding) protected ByteArrayOutputStream
writeMainSection
(byte[] decoded, List<PostscriptParser.PSElement> mainSection, PostscriptParser.PSElement charStrings) protected void
writeString
(String entry, ByteArrayOutputStream boas)
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOG -
subsetCharStrings
-
charNames
-
uniqueSubs
-
eol
-
subsetSubroutines
protected boolean subsetSubroutines -
headerSection
-
mainSection
-
standardEncoding
protected boolean standardEncoding
-
-
Constructor Details
-
Type1SubsetFile
public Type1SubsetFile()
-
-
Method Details
-
createSubset
- Throws:
IOException
-
stitchFont
public byte[] stitchFont(ByteArrayOutputStream boasHeader, ByteArrayOutputStream boasMain, ByteArrayOutputStream boasTrailer) throws IOException - Throws:
IOException
-
searchEntries
-
writeHeader
protected ByteArrayOutputStream writeHeader(PFBData pfbData, PostscriptParser.PSElement encoding) throws IOException - Throws:
IOException
-
writeMainSection
protected ByteArrayOutputStream writeMainSection(byte[] decoded, List<PostscriptParser.PSElement> mainSection, PostscriptParser.PSElement charStrings) throws IOException - Throws:
IOException
-
findVariable
protected String findVariable(byte[] decoded, List<PostscriptParser.PSElement> elements, String[] matches, String fallback) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
writeString
- Throws:
IOException
-
getBinaryEntry
protected byte[] getBinaryEntry(int[] position, byte[] decoded) Returns a section of a byte array determined by it's start and end position.- Parameters:
position
- An array containing both the start and end position of the section to copy.decoded
- The array from which to copy a section of data- Returns:
- Returns the copy of the data section
-
getEntryPart
-
getElement
protected PostscriptParser.PSElement getElement(String elementID, List<PostscriptParser.PSElement> elements)
-