public abstract class FontProgram extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
avgWidth |
protected Map<Integer,Glyph> |
codeToGlyph |
static int |
DEFAULT_WIDTH |
protected String |
encodingScheme
The font's encoding name.
|
protected FontIdentification |
fontIdentification |
protected FontMetrics |
fontMetrics |
protected FontNames |
fontNames |
protected boolean |
isFontSpecific |
protected String |
registry |
protected Map<Integer,Glyph> |
unicodeToGlyph |
static int |
UNITS_NORMALIZATION |
Constructor and Description |
---|
FontProgram() |
Modifier and Type | Method and Description |
---|---|
int |
countOfGlyphs() |
protected void |
fixSpaceIssue() |
int |
getAvgWidth() |
int[] |
getCharBBox(int unicode)
Get glyph's bbox.
|
FontIdentification |
getFontIdentification() |
FontMetrics |
getFontMetrics() |
FontNames |
getFontNames() |
Glyph |
getGlyph(int unicode) |
Glyph |
getGlyphByCode(int charCode) |
abstract int |
getKerning(Glyph first, Glyph second)
Gets the kerning between two glyphs.
|
int |
getKerning(int first, int second)
Gets the kerning between two glyphs.
|
abstract int |
getPdfFontFlags() |
String |
getRegistry() |
int |
getWidth(int unicode)
Get glyph's width.
|
boolean |
hasKernPairs() |
boolean |
isBuiltWith(String fontName)
Checks whether the FontProgram was built with corresponding fontName.
|
boolean |
isFontSpecific() |
protected void |
setBbox(int[] bbox) |
protected void |
setBold(boolean isBold) |
protected void |
setCapHeight(int capHeight) |
protected void |
setFixedPitch(boolean isFixedPitch) |
protected void |
setFontFamily(String fontFamily)
Sets a preferred font family name.
|
protected void |
setFontName(String fontName)
Sets the PostScript name of the font.
|
protected void |
setFontStretch(String fontWidth)
Sets font width in css notation (font-stretch property)
|
protected void |
setFontWeight(int fontWeight)
Sets font weight.
|
protected void |
setItalicAngle(int italicAngle)
Sets the PostScript italic angel.
|
protected void |
setRegistry(String registry) |
protected void |
setStemH(int stemH) |
protected void |
setStemV(int stemV) |
protected void |
setTypoAscender(int ascender) |
protected void |
setTypoDescender(int descender) |
protected void |
setXHeight(int xHeight) |
String |
toString() |
public static final int DEFAULT_WIDTH
public static final int UNITS_NORMALIZATION
protected boolean isFontSpecific
protected FontNames fontNames
protected FontMetrics fontMetrics
protected FontIdentification fontIdentification
protected int avgWidth
protected String encodingScheme
protected String registry
public int countOfGlyphs()
public FontNames getFontNames()
public FontMetrics getFontMetrics()
public FontIdentification getFontIdentification()
public String getRegistry()
public abstract int getPdfFontFlags()
public boolean isFontSpecific()
public int getWidth(int unicode)
unicode
- a unicode symbol or FontSpecif code.
public int getAvgWidth()
public int[] getCharBBox(int unicode)
unicode
- a unicode symbol or FontSpecif code.
public Glyph getGlyph(int unicode)
public Glyph getGlyphByCode(int charCode)
public boolean hasKernPairs()
public int getKerning(int first, int second)
first
- the first unicode value
second
- the second unicode value
public abstract int getKerning(Glyph first, Glyph second)
first
- the first glyph
second
- the second glyph
public boolean isBuiltWith(String fontName)
FontProgram
was built with corresponding fontName. Default value is false unless overridden.
fontName
- a font name or path to a font program
protected void setRegistry(String registry)
protected void setTypoAscender(int ascender)
protected void setTypoDescender(int descender)
protected void setCapHeight(int capHeight)
protected void setXHeight(int xHeight)
protected void setItalicAngle(int italicAngle)
Italic angle in counter-clockwise degrees from the vertical. Zero for upright text, negative for text that leans to the right (forward).
italicAngle
- in counter-clockwise degrees from the vertical
protected void setStemV(int stemV)
protected void setStemH(int stemH)
protected void setFontWeight(int fontWeight)
fontWeight
- integer form 100 to 900. See FontWeights
.
protected void setFontStretch(String fontWidth)
fontWidth
- FontStretches
.
protected void setFixedPitch(boolean isFixedPitch)
protected void setBold(boolean isBold)
protected void setBbox(int[] bbox)
protected void setFontFamily(String fontFamily)
fontFamily
- a preferred font family name.
protected void setFontName(String fontName)
If full name is null, it will be set as well.
fontName
- the PostScript name of the font, shall not be null or empty.
protected void fixSpaceIssue()
Copyright © 1998–2020 iText Group NV. All rights reserved.