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
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, toString
protected 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
IOException
public TrueTypeFont(byte[] ttf) throws IOException
IOException
public boolean hasKernPairs()
hasKernPairs
in class FontProgram
public int getKerning(Glyph first, Glyph second)
getKerning
in class FontProgram
first
- the first glyph
second
- the second glyph
public boolean isCff()
public byte[] getFontStreamBytes()
public int getPdfFontFlags()
getPdfFontFlags
in class FontProgram
public int getDirectoryOffset()
public GlyphSubstitutionTableReader getGsubTable()
public GlyphPositioningTableReader getGposTable()
public OpenTypeGdefTableReader getGdefTable()
protected void readGdefTable() throws IOException
IOException
protected void readGsubTable() throws IOException
IOException
protected void readGposTable() throws IOException
IOException
public String[] getCodePagesSupported()
public boolean isBuiltWith(String fontProgram)
FontProgram
FontProgram
was built with corresponding fontName. Default value is false unless overridden.
isBuiltWith
in class FontProgram
fontProgram
- a font name or path to a font program
public void close() throws IOException
IOException
public void updateUsedGlyphs(SortedSet<Integer> usedGlyphs, boolean subset, ListsubsetRanges)
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 status
subsetRanges
- additional subset ranges
Copyright © 1998–2021 iText Group NV. All rights reserved.