public class PdfType0Font extends PdfFont
Modifier and Type | Field and Description |
---|---|
protected static int |
CID_FONT_TYPE_0 |
protected static int |
CID_FONT_TYPE_2 |
protected int |
cidFontType |
protected CMapEncoding |
cmapEncoding |
protected Map<Integer,int[]> |
longTag |
protected char[] |
specificUnicodeDifferences |
protected boolean |
vertical |
embedded, emptyBytes, fontProgram, newFont, notdefGlyphs, subset, subsetRanges
Modifier and Type | Method and Description |
---|---|
protected void |
addRangeUni(TrueTypeFont ttf, Map<Integer,int[]> longTag, boolean includeMetrics) |
int |
appendAnyGlyph(String text, int from, List<Glyph> glyphs)
Append any single glyph, even notdef.
|
int |
appendGlyphs(String text, int from, int to, List<Glyph> glyphs)
Append all supported glyphs and return number of processed chars.
|
boolean |
containsGlyph(int unicode)
Check whether font contains glyph with specified unicode.
|
boolean |
containsGlyph(String text, int from)
Check whether font contains glyph with specified unicode.
|
byte[] |
convertToBytes(Glyph glyph) |
byte[] |
convertToBytes(GlyphLine glyphLine) |
byte[] |
convertToBytes(String text)
Converts the text into bytes to be placed in the document.
|
GlyphLine |
createGlyphLine(String content) |
String |
decode(PdfString content) |
GlyphLine |
decodeIntoGlyphLine(PdfString content)
Decodes a given PdfString containing encoded string (e.g.
|
void |
flush()
To manually flush a PdfObject behind this wrapper, you have to ensure that this object is added to the document, i.e.
|
protected PdfDictionary |
getCidFontType2(TrueTypeFont ttf, PdfDictionary fontDescriptor, String fontName, int[][] metrics)
Generates the CIDFontTyte2 dictionary.
|
CMapEncoding |
getCmap() |
float |
getContentWidth(PdfString content) |
protected PdfDictionary |
getFontDescriptor(String fontName) |
Glyph |
getGlyph(int unicode)
Get glyph by unicode
|
PdfStream |
getToUnicode(Object[] metrics)
Creates a ToUnicode CMap to allow copy and paste from Acrobat.
|
static String |
getUniMapFromOrdering(String ordering) |
void |
writeText(GlyphLine text, int from, int to, PdfOutputStream stream) |
void |
writeText(String text, PdfOutputStream stream) |
addSubsetRange, checkFontDictionary, checkTrueTypeFontDictionary, checkTrueTypeFontDictionary, compactRanges, containsGlyph, createSubsetPrefix, getAscent, getAscent, getDescent, getDescent, getFontMatrix, getFontProgram, getPdfFontStream, getWidth, getWidth, getWidth, getWidth, isEmbedded, isSubset, isWrappedObjectMustBeIndirect, setSubset, splitString, splitString, toString, updateSubsetPrefix, writeText
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
protected static final int CID_FONT_TYPE_0
protected static final int CID_FONT_TYPE_2
protected boolean vertical
protected CMapEncoding cmapEncoding
protected int cidFontType
protected char[] specificUnicodeDifferences
public Glyph getGlyph(int unicode)
PdfFont
public boolean containsGlyph(String text, int from)
PdfFont
containsGlyph
in class PdfFont
text
- a java unicode string
from
- start index. one or two char may be used.
public boolean containsGlyph(int unicode)
PdfFont
containsGlyph
in class PdfFont
unicode
- a unicode code point
public byte[] convertToBytes(String text)
PdfFont
convertToBytes
in class PdfFont
text
- the text to convert
public byte[] convertToBytes(GlyphLine glyphLine)
convertToBytes
in class PdfFont
public byte[] convertToBytes(Glyph glyph)
convertToBytes
in class PdfFont
public void writeText(GlyphLine text, int from, int to, PdfOutputStream stream)
public void writeText(String text, PdfOutputStream stream)
public GlyphLine createGlyphLine(String content)
createGlyphLine
in class PdfFont
public int appendGlyphs(String text, int from, int to, List<Glyph> glyphs)
PdfFont
appendGlyphs
in class PdfFont
text
- String to convert to glyphs.
from
- from index of the text.
to
- to index of the text.
glyphs
- array for a new glyphs, shall not be null.
public int appendAnyGlyph(String text, int from, List<Glyph> glyphs)
PdfFont
appendAnyGlyph
in class PdfFont
text
- String to convert to glyphs.
from
- from index of the text.
glyphs
- array for a new glyph, shall not be null.
public GlyphLine decodeIntoGlyphLine(PdfString content)
decodeIntoGlyphLine
in class PdfFont
content
- the encoded string
GlyphLine
containing the glyphs encoded by the passed string
public float getContentWidth(PdfString content)
getContentWidth
in class PdfFont
public void flush()
PdfFont
PdfObject
behind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference. Basically this means that before flushing you need to explicitly call PdfObjectWrapper.makeIndirect(PdfDocument)
. For example: wrapperInstance.makeIndirect(document).flush(); Note that not every wrapper require this, only those that have such warning in documentation.
public CMapEncoding getCmap()
public PdfStream getToUnicode(Object[] metrics)
metrics
- metrics[0] contains the glyph index and metrics[2] contains the Unicode code
null
protected PdfDictionary getFontDescriptor(String fontName)
getFontDescriptor
in class PdfFont
protected PdfDictionary getCidFontType2(TrueTypeFont ttf, PdfDictionary fontDescriptor, String fontName, int[][] metrics)
fontDescriptor
- the indirect reference to the font descriptor
fontName
- a name of the font
metrics
- the horizontal width metrics
protected void addRangeUni(TrueTypeFont ttf, Map<Integer,int[]> longTag, boolean includeMetrics)
Copyright © 1998–2018 iText Group NV. All rights reserved.