final class PDCIDFontType2Embedder extends TrueTypeEmbedder
Modifier and Type | Class and Description |
---|---|
(package private) static class |
PDCIDFontType2Embedder.State |
Modifier and Type | Field and Description |
---|---|
private COSDictionary |
cidFont |
private COSDictionary |
dict |
private PDDocument |
document |
private static org.apache.commons.logging.Log |
LOG |
private PDType0Font |
parent |
private boolean |
vertical |
cmap, cmapLookup, fontDescriptor, ttf
Constructor and Description |
---|
PDCIDFontType2Embedder(PDDocument document,
COSDictionary dict,
TrueTypeFont ttf,
boolean embedSubset,
PDType0Font parent,
boolean vertical)
Creates a new TrueType font embedder for the given TTF as a PDCIDFontType2.
|
Modifier and Type | Method and Description |
---|---|
private void |
addNameTag(java.lang.String tag) |
private void |
buildCIDSet(java.util.Map<java.lang.Integer,java.lang.Integer> cidToGid)
Builds the CIDSet entry, required by PDF/A.
|
private void |
buildCIDToGIDMap(java.util.Map<java.lang.Integer,java.lang.Integer> cidToGid) |
protected void |
buildSubset(java.io.InputStream ttfSubset,
java.lang.String tag,
java.util.Map<java.lang.Integer,java.lang.Integer> gidToCid)
Rebuild a font subset.
|
private void |
buildToUnicodeCMap(java.util.Map<java.lang.Integer,java.lang.Integer> newGIDToOldCID) |
private boolean |
buildVerticalHeader(COSDictionary cidFont) |
private void |
buildVerticalMetrics(COSDictionary cidFont)
Build vertical metrics with Identity CIDToGIDMap (for embedding full font).
|
private void |
buildVerticalMetrics(java.util.Map<java.lang.Integer,java.lang.Integer> cidToGid)
Builds vertical metrics with a custom CIDToGIDMap (for embedding font subset).
|
private void |
buildWidths(COSDictionary cidFont)
Build widths with Identity CIDToGIDMap (for embedding full font).
|
private void |
buildWidths(java.util.Map<java.lang.Integer,java.lang.Integer> cidToGid)
Builds widths with a custom CIDToGIDMap (for embedding font subset).
|
private COSDictionary |
createCIDFont() |
PDCIDFont |
getCIDFont()
Returns the descendant CIDFont.
|
private COSArray |
getVerticalMetrics(int[] values) |
private COSArray |
getWidths(int[] widths) |
private COSDictionary |
toCIDSystemInfo(java.lang.String registry,
java.lang.String ordering,
int supplement) |
addToSubset, buildFontFile2, getFontDescriptor, getTag, getTrueTypeFont, needsSubset, subset
private static final org.apache.commons.logging.Log LOG
private final PDDocument document
private final PDType0Font parent
private final COSDictionary dict
private final COSDictionary cidFont
private final boolean vertical
PDCIDFontType2Embedder(PDDocument document, COSDictionary dict, TrueTypeFont ttf, boolean embedSubset, PDType0Font parent, boolean vertical) throws java.io.IOException
document
- parent documentdict
- font dictionaryttf
- True Type Fontparent
- parent Type 0 fontjava.io.IOException
- if the TTF could not be readprotected void buildSubset(java.io.InputStream ttfSubset, java.lang.String tag, java.util.Map<java.lang.Integer,java.lang.Integer> gidToCid) throws java.io.IOException
buildSubset
in class TrueTypeEmbedder
java.io.IOException
private void buildToUnicodeCMap(java.util.Map<java.lang.Integer,java.lang.Integer> newGIDToOldCID) throws java.io.IOException
java.io.IOException
private COSDictionary toCIDSystemInfo(java.lang.String registry, java.lang.String ordering, int supplement)
private COSDictionary createCIDFont() throws java.io.IOException
java.io.IOException
private void addNameTag(java.lang.String tag)
private void buildCIDToGIDMap(java.util.Map<java.lang.Integer,java.lang.Integer> cidToGid) throws java.io.IOException
java.io.IOException
private void buildCIDSet(java.util.Map<java.lang.Integer,java.lang.Integer> cidToGid) throws java.io.IOException
java.io.IOException
private void buildWidths(java.util.Map<java.lang.Integer,java.lang.Integer> cidToGid) throws java.io.IOException
java.io.IOException
private boolean buildVerticalHeader(COSDictionary cidFont) throws java.io.IOException
java.io.IOException
private void buildVerticalMetrics(java.util.Map<java.lang.Integer,java.lang.Integer> cidToGid) throws java.io.IOException
java.io.IOException
private void buildWidths(COSDictionary cidFont) throws java.io.IOException
java.io.IOException
private COSArray getWidths(int[] widths) throws java.io.IOException
java.io.IOException
private void buildVerticalMetrics(COSDictionary cidFont) throws java.io.IOException
java.io.IOException
private COSArray getVerticalMetrics(int[] values) throws java.io.IOException
java.io.IOException
public PDCIDFont getCIDFont() throws java.io.IOException
java.io.IOException