public class TrueTypeFont extends FontProgram
| Modifier and Type | Field and Description |
|---|---|
protected int[][] |
bBoxes |
protected boolean |
isVertical |
protected com.itextpdf.io.util.IntHashtable |
kerning
The map containing the kerning information.
|
avgWidth, codeToGlyph, DEFAULT_WIDTH, encodingScheme, fontIdentification, fontMetrics, fontNames, isFontSpecific, registry, unicodeToGlyph, UNITS_NORMALIZATION| Modifier | Constructor and Description |
|---|---|
protected |
TrueTypeFont() |
|
TrueTypeFont(byte[] ttf) |
|
TrueTypeFont(String path) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Map<Integer,int[]> |
getActiveCmap() |
String[] |
getCodePagesSupported()
Gets the code pages supported by the font.
|
int |
getDirectoryOffset()
The offset from the start of the file to the table directory.
|
byte[] |
getFontStreamBytes() |
OpenTypeGdefTableReader |
getGdefTable() |
GlyphPositioningTableReader |
getGposTable() |
GlyphSubstitutionTableReader |
getGsubTable() |
int |
getKerning(Glyph first,
Glyph second)
Gets the kerning between two glyphs.
|
int |
getPdfFontFlags() |
byte[] |
getSubset(Set<Integer> glyphs,
boolean subset) |
boolean |
hasKernPairs() |
boolean |
isBuiltWith(String fontProgram)
Checks whether the
FontProgram was built with corresponding fontName. |
boolean |
isCff() |
protected void |
readGdefTable() |
protected void |
readGposTable() |
protected void |
readGsubTable() |
void |
updateUsedGlyphs(SortedSet<Integer> usedGlyphs,
boolean subset,
List<int[]> subsetRanges)
The method will update usedGlyphs with additional range or with all glyphs if there is no subset.
|
countOfGlyphs, fixSpaceIssue, getAvgWidth, getCharBBox, getFontIdentification, getFontMetrics, getFontNames, getGlyph, getGlyphByCode, getKerning, getRegistry, getWidth, isFontSpecific, setBbox, setBold, setCapHeight, setFixedPitch, setFontFamily, setFontName, setFontStretch, setFontWeight, setItalicAngle, setRegistry, setStemH, setStemV, setTypoAscender, setTypoDescender, setXHeight, toStringprotected int[][] bBoxes
protected boolean isVertical
protected com.itextpdf.io.util.IntHashtable kerning
Integer where the top 16 bits
are the glyph number for the first character and the lower 16 bits are the
glyph number for the second character. The value is the amount of kerning in
normalized 1000 units as an Integer. This value is usually negative.protected TrueTypeFont()
public TrueTypeFont(String path) throws IOException
IOExceptionpublic TrueTypeFont(byte[] ttf)
throws IOException
IOExceptionpublic boolean hasKernPairs()
hasKernPairs in class FontProgrampublic int getKerning(Glyph first, Glyph second)
getKerning in class FontProgramfirst - the first glyphsecond - the second glyphpublic boolean isCff()
public byte[] getFontStreamBytes()
public int getPdfFontFlags()
getPdfFontFlags in class FontProgrampublic int getDirectoryOffset()
public GlyphSubstitutionTableReader getGsubTable()
public GlyphPositioningTableReader getGposTable()
public OpenTypeGdefTableReader getGdefTable()
protected void readGdefTable()
throws IOException
IOExceptionprotected void readGsubTable()
throws IOException
IOExceptionprotected void readGposTable()
throws IOException
IOExceptionpublic String[] getCodePagesSupported()
public boolean isBuiltWith(String fontProgram)
FontProgramFontProgram was built with corresponding fontName.
Default value is false unless overridden.isBuiltWith in class FontProgramfontProgram - a font name or path to a font programpublic void close()
throws IOException
IOExceptionpublic void updateUsedGlyphs(SortedSet<Integer> usedGlyphs, boolean subset, List<int[]> subsetRanges)
usedGlyphs - a set of integers, which are glyph ids that denote used glyphs.
This set is updated inside of the method if needed.subset - subset statussubsetRanges - additional subset rangesCopyright © 1998–2019 iText Group NV. All rights reserved.