Package com.itextpdf.io.font
Class Type1Font
java.lang.Object
com.itextpdf.io.font.FontProgram
com.itextpdf.io.font.Type1Font
-
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static Type1Font
createStandardFont
(String name) byte[]
int[]
Find glyph by glyph name.int
getKerning
(Glyph first, Glyph second) Gets the kerning between two glyphs.int
boolean
Checks if the font has any kerning pairs.boolean
boolean
isBuiltWith
(String fontProgram) Checks whether theFontProgram
was built with corresponding fontName.protected void
process()
boolean
setKerning
(int first, int second, int kern) Sets the kerning between two Unicode chars.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, isFontSpecific, setBbox, setBold, setCapHeight, setFixedPitch, setFontFamily, setFontName, setFontStretch, setFontWeight, setItalicAngle, setRegistry, setStemH, setStemV, setTypoAscender, setTypoDescender, setXHeight, toString
-
Constructor Details
-
Type1Font
protected Type1Font() -
Type1Font
protected Type1Font(String metricsPath, String binaryPath, byte[] afm, byte[] pfb) throws IOException - Throws:
-
IOException
-
Type1Font
-
-
Method Details
-
createStandardFont
- Throws:
-
IOException
-
isBuiltInFont
public boolean isBuiltInFont() -
getPdfFontFlags
public int getPdfFontFlags()- Specified by:
-
getPdfFontFlags
in classFontProgram
-
getCharacterSet
-
hasKernPairs
public boolean hasKernPairs()Checks if the font has any kerning pairs.- Overrides:
-
hasKernPairs
in classFontProgram
- Returns:
-
true
if the font has any kerning pairs.
-
getKerning
Description copied from class:FontProgram
Gets the kerning between two glyphs.- Specified by:
-
getKerning
in classFontProgram
- Parameters:
-
first
- the first glyph -
second
- the second glyph - Returns:
- the kerning to be applied
-
setKerning
public boolean setKerning(int first, int second, int kern) Sets the kerning between two Unicode chars.- Parameters:
-
first
- the first unicode char. -
second
- the second unicode char. -
kern
- the kerning to apply in normalized 1000 units. - Returns:
-
true
if the kerning was applied,false
otherwise.
-
getGlyph
Find glyph by glyph name.- Parameters:
-
name
- Glyph name - Returns:
- Glyph instance if found, otherwise null.
-
getFontStreamBytes
public byte[] getFontStreamBytes() -
getFontStreamLengths
public int[] getFontStreamLengths() -
isBuiltWith
Description copied from class:FontProgram
Checks whether theFontProgram
was built with corresponding fontName. Default value is false unless overridden.- Overrides:
-
isBuiltWith
in classFontProgram
- Parameters:
-
fontProgram
- a font name or path to a font program - Returns:
- true, if the FontProgram was built with the fontProgram. Otherwise false.
-
process
- Throws:
-
IOException
-