Package com.itextpdf.kernel.font
Class Type3Font
java.lang.Object
com.itextpdf.io.font.FontProgram
com.itextpdf.kernel.font.Type3Font
FontProgram class for Type 3 font. Contains map of
Type3Glyph
. Type3Glyphs belong to a particular pdf document. Note, an instance of Type3Font can not be reused for multiple pdf documents.
-
Field Summary
Fields inherited from class com.itextpdf.io.font.FontProgram
avgWidth, codeToGlyph, DEFAULT_WIDTH, encodingScheme, fontIdentification, fontMetrics, fontNames, HORIZONTAL_SCALING_FACTOR, isFontSpecific, registry, unicodeToGlyph, UNITS_NORMALIZATION
-
Method Summary
Modifier and TypeMethodDescriptionint
getKerning
(Glyph glyph1, Glyph glyph2) Gets the kerning between two glyphs.int
Returns number of glyphs for this font.int
getType3Glyph
(int unicode) Returns a glyph by unicode.getType3GlyphByCode
(int code) Returns a glyph by its code.boolean
boolean
protected void
setCapHeight
(int capHeight) Sets the capital letters height.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 angle.protected void
setTypoAscender
(int ascender) Sets typo ascender.protected void
setTypoDescender
(int descender) Sets typo descender.Methods inherited from class com.itextpdf.io.font.FontProgram
convertGlyphSpaceToTextSpace, convertGlyphSpaceToTextSpace, convertGlyphSpaceToTextSpace, convertTextSpaceToGlyphSpace, countOfGlyphs, fixSpaceIssue, getAvgWidth, getCharBBox, getFontIdentification, getFontMetrics, getFontNames, getGlyph, getGlyphByCode, getKerning, getRegistry, getWidth, hasKernPairs, isBuiltWith, setBbox, setBold, setFixedPitch, setRegistry, setStemH, setStemV, setXHeight, toString
-
Method Details
-
getType3Glyph
Returns a glyph by unicode.- Parameters:
-
unicode
- glyph unicode - Returns:
-
Type3Glyph
glyph, ornull
if this font does not contain glyph for the unicode
-
getType3GlyphByCode
Returns a glyph by its code. These glyphs may not have unicode.- Parameters:
-
code
- glyph code - Returns:
-
Type3Glyph
glyph, ornull
if this font does not contain glyph for the code
-
getPdfFontFlags
public int getPdfFontFlags()- Specified by:
-
getPdfFontFlags
in classFontProgram
-
isFontSpecific
public boolean isFontSpecific()- Overrides:
-
isFontSpecific
in classFontProgram
-
isColorized
public boolean isColorized() -
getKerning
Description copied from class:FontProgram
Gets the kerning between two glyphs.- Specified by:
-
getKerning
in classFontProgram
- Parameters:
-
glyph1
- the first glyph -
glyph2
- the second glyph - Returns:
- the kerning to be applied
-
getNumberOfGlyphs
public int getNumberOfGlyphs()Returns number of glyphs for this font. Its also count glyphs without unicode. Seetype3GlyphsWithoutUnicode
.- Returns:
-
int
number off all glyphs
-
setFontName
Sets the PostScript name of the font.If full name is null, it will be set as well.
- Overrides:
-
setFontName
in classFontProgram
- Parameters:
-
fontName
- the PostScript name of the font, shall not be null or empty.
-
setFontFamily
Sets a preferred font family name.- Overrides:
-
setFontFamily
in classFontProgram
- Parameters:
-
fontFamily
- a preferred font family name.
-
setFontWeight
protected void setFontWeight(int fontWeight) Sets font weight.- Overrides:
-
setFontWeight
in classFontProgram
- Parameters:
-
fontWeight
- integer form 100 to 900. SeeFontWeights
.
-
setFontStretch
Sets font width in css notation (font-stretch property)- Overrides:
-
setFontStretch
in classFontProgram
- Parameters:
-
fontWidth
-FontStretches
.
-
setCapHeight
protected void setCapHeight(int capHeight) Sets the capital letters height. See alsoFontMetrics.setCapHeight(int)
.- Overrides:
-
setCapHeight
in classFontProgram
- Parameters:
-
capHeight
- cap height in 1000-units
-
setItalicAngle
protected void setItalicAngle(int italicAngle) Sets the PostScript italic angle.Italic angle in counter-clockwise degrees from the vertical. Zero for upright text, negative for text that leans to the right (forward).
- Overrides:
-
setItalicAngle
in classFontProgram
- Parameters:
-
italicAngle
- in counter-clockwise degrees from the vertical
-
setTypoAscender
protected void setTypoAscender(int ascender) Sets typo ascender. See alsoFontMetrics.setTypoAscender(int)
.- Overrides:
-
setTypoAscender
in classFontProgram
- Parameters:
-
ascender
- typo ascender value in 1000-units
-
setTypoDescender
protected void setTypoDescender(int descender) Sets typo descender. See alsoFontMetrics.setTypoDescender(int)
.- Overrides:
-
setTypoDescender
in classFontProgram
- Parameters:
-
descender
- typo descender value in 1000-units
-