public class ItextTrueTypeFont
extends com.itextpdf.io.font.TrueTypeFont
由于 TrueTypeFont(OpenTypeParser fontParser) 构造器私有无法扩展自定义字体解析器,因此采用重载重新部分功能。 源码来自于Itext 7.1.13 的TrueTypeFont类 使用类ItextOpenTypeParser替换了类OpenTypeParser
| 限定符和类型 | 字段和说明 |
|---|---|
protected int[][] |
bBoxes |
protected boolean |
isVertical |
protected com.itextpdf.io.util.IntHashtable |
kerning
The map containing the kerning information.
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
ItextTrueTypeFont() |
|
ItextTrueTypeFont(byte[] ttf) |
|
ItextTrueTypeFont(String path) |
| 限定符和类型 | 方法和说明 |
|---|---|
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() |
com.itextpdf.io.font.otf.OpenTypeGdefTableReader |
getGdefTable() |
com.itextpdf.io.font.otf.GlyphPositioningTableReader |
getGposTable() |
com.itextpdf.io.font.otf.GlyphSubstitutionTableReader |
getGsubTable() |
int |
getKerning(com.itextpdf.io.font.otf.Glyph first,
com.itextpdf.io.font.otf.Glyph second)
Gets the kerning between two glyphs.
|
int |
getPdfFontFlags() |
byte[] |
getSubset(Set<Integer> glyphs,
boolean subset) |
boolean |
hasKernPairs() |
boolean |
isBuiltWith(String fontProgram) |
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 ItextTrueTypeFont()
public ItextTrueTypeFont(String path) throws IOException
IOExceptionpublic ItextTrueTypeFont(byte[] ttf)
throws IOException
IOExceptionpublic boolean hasKernPairs()
hasKernPairs 在类中 com.itextpdf.io.font.TrueTypeFontpublic int getKerning(com.itextpdf.io.font.otf.Glyph first,
com.itextpdf.io.font.otf.Glyph second)
getKerning 在类中 com.itextpdf.io.font.TrueTypeFontfirst - the first glyphsecond - the second glyphpublic boolean isCff()
isCff 在类中 com.itextpdf.io.font.TrueTypeFontpublic Map<Integer,int[]> getActiveCmap()
getActiveCmap 在类中 com.itextpdf.io.font.TrueTypeFontpublic byte[] getFontStreamBytes()
getFontStreamBytes 在类中 com.itextpdf.io.font.TrueTypeFontpublic int getPdfFontFlags()
getPdfFontFlags 在类中 com.itextpdf.io.font.TrueTypeFontpublic int getDirectoryOffset()
getDirectoryOffset 在类中 com.itextpdf.io.font.TrueTypeFontpublic com.itextpdf.io.font.otf.GlyphSubstitutionTableReader getGsubTable()
getGsubTable 在类中 com.itextpdf.io.font.TrueTypeFontpublic com.itextpdf.io.font.otf.GlyphPositioningTableReader getGposTable()
getGposTable 在类中 com.itextpdf.io.font.TrueTypeFontpublic com.itextpdf.io.font.otf.OpenTypeGdefTableReader getGdefTable()
getGdefTable 在类中 com.itextpdf.io.font.TrueTypeFontpublic byte[] getSubset(Set<Integer> glyphs, boolean subset)
getSubset 在类中 com.itextpdf.io.font.TrueTypeFontprotected void readGdefTable()
throws IOException
readGdefTable 在类中 com.itextpdf.io.font.TrueTypeFontIOExceptionprotected void readGsubTable()
throws IOException
readGsubTable 在类中 com.itextpdf.io.font.TrueTypeFontIOExceptionprotected void readGposTable()
throws IOException
readGposTable 在类中 com.itextpdf.io.font.TrueTypeFontIOExceptionpublic String[] getCodePagesSupported()
getCodePagesSupported 在类中 com.itextpdf.io.font.TrueTypeFontpublic boolean isBuiltWith(String fontProgram)
isBuiltWith 在类中 com.itextpdf.io.font.TrueTypeFontpublic void close()
throws IOException
close 在类中 com.itextpdf.io.font.TrueTypeFontIOExceptionpublic void updateUsedGlyphs(SortedSet<Integer> usedGlyphs, boolean subset, List<int[]> subsetRanges)
updateUsedGlyphs 在类中 com.itextpdf.io.font.TrueTypeFontusedGlyphs - 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 © 2024. All rights reserved.