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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static Type1FontcreateStandardFont(String name) byte[]int[]Find glyph by glyph name.intgetKerning(Glyph first, Glyph second) Gets the kerning between two glyphs.intbooleanChecks if the font has any kerning pairs.voidinitializeGlyphs(FontEncoding fontEncoding) Fills missing character codes incodeToGlyphmap.booleanbooleanisBuiltWith(String fontProgram) Checks whether theFontProgramwas built with corresponding fontName.protected voidprocess()booleansetKerning(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
-
initializeGlyphs
Fills missing character codes incodeToGlyphmap.- Parameters:
-
fontEncoding- to be used to map unicode values to character codes.
-
isBuiltInFont
public boolean isBuiltInFont() -
getPdfFontFlags
public int getPdfFontFlags()- Specified by:
-
getPdfFontFlagsin classFontProgram
-
getCharacterSet
-
hasKernPairs
public boolean hasKernPairs()Checks if the font has any kerning pairs.- Overrides:
-
hasKernPairsin classFontProgram - Returns:
-
trueif the font has any kerning pairs.
-
getKerning
Description copied from class:FontProgramGets the kerning between two glyphs.- Specified by:
-
getKerningin 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:
-
trueif the kerning was applied,falseotherwise.
-
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:FontProgramChecks whether theFontProgramwas built with corresponding fontName. Default value is false unless overridden.- Overrides:
-
isBuiltWithin 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
-