Package com.itextpdf.kernel.font
Class PdfType1Font
- java.lang.Object
-
- com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
-
- com.itextpdf.kernel.font.PdfFont
-
- com.itextpdf.kernel.font.PdfSimpleFont<Type1Font>
-
- com.itextpdf.kernel.font.PdfType1Font
-
public class PdfType1Font extends PdfSimpleFont<Type1Font>
-
-
Field Summary
-
Fields inherited from class com.itextpdf.kernel.font.PdfSimpleFont
fontEncoding, forceWidthsOutput, toUnicode, usedGlyphs
-
Fields inherited from class com.itextpdf.kernel.font.PdfFont
embedded, EMPTY_BYTES, fontProgram, newFont, notdefGlyphs, SIMPLE_FONT_MAX_CHAR_CODE_VALUE, subset, subsetRanges
-
-
Constructor Summary
Constructors Constructor Description PdfType1Font(Type1Font type1Font, java.lang.String encoding)
PdfType1Font(Type1Font type1Font, java.lang.String encoding, boolean embedded)
PdfType1Font(PdfDictionary fontDictionary)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addFontStream(PdfDictionary fontDescriptor)
If the embedded flag isfalse
or if the font is one of the 14 built in types, it returnsnull
, otherwise the font is read and output in a PdfStream object.boolean
containsGlyph(int unicode)
Check whether font contains glyph with specified unicode.void
flush()
To manually flush aPdfObject
behind this wrapper, you have to ensure that this object is added to the document, i.e.Glyph
getGlyph(int unicode)
Get glyph by unicodeprotected boolean
isBuiltInFont()
Indicates that the font is built in, i.e.boolean
isSubset()
Indicates if all the glyphs and widths for that particular encoding should be included in the document.void
setSubset(boolean subset)
Indicates if all the glyphs and widths for that particular encoding should be included in the document.-
Methods inherited from class com.itextpdf.kernel.font.PdfSimpleFont
appendAnyGlyph, appendDecodedCodesToGlyphsList, appendGlyphs, buildWidthsArray, convertToBytes, convertToBytes, convertToBytes, createGlyphLine, decode, decodeIntoGlyphLine, flushFontData, getContentWidth, getFontDescriptor, getFontEncoding, getToUnicode, isBuiltWith, isForceWidthsOutput, setFontProgram, setForceWidthsOutput, writeText, writeText
-
Methods inherited from class com.itextpdf.kernel.font.PdfFont
addSubsetRange, getAscent, getAscent, getDescent, getDescent, getFontProgram, getPdfFontStream, getWidth, getWidth, getWidth, getWidth, isEmbedded, isWrappedObjectMustBeIndirect, makeObjectIndirect, splitString, toString, updateSubsetPrefix
-
Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
-
-
-
Constructor Detail
-
PdfType1Font
PdfType1Font(Type1Font type1Font, java.lang.String encoding, boolean embedded)
-
PdfType1Font
PdfType1Font(Type1Font type1Font, java.lang.String encoding)
-
PdfType1Font
PdfType1Font(PdfDictionary fontDictionary)
-
-
Method Detail
-
isSubset
public boolean isSubset()
Description copied from class:PdfFont
Indicates if all the glyphs and widths for that particular encoding should be included in the document.
-
setSubset
public void setSubset(boolean subset)
Description copied from class:PdfFont
Indicates if all the glyphs and widths for that particular encoding should be included in the document. When set totrue
only the glyphs used will be included in the font. When set tofalse
the full font will be included and all subset ranges will be removed.- Overrides:
setSubset
in classPdfFont
- Parameters:
subset
- new value of property subset- See Also:
PdfFont.addSubsetRange(int[])
-
flush
public void flush()
Description copied from class:PdfFont
To manually flush aPdfObject
behind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference. Basically this means that before flushing you need to explicitly callPdfObjectWrapper.makeIndirect(PdfDocument)
. For example: wrapperInstance.makeIndirect(document).flush(); Note that not every wrapper require this, only those that have such warning in documentation.
-
getGlyph
public Glyph getGlyph(int unicode)
Description copied from class:PdfFont
Get glyph by unicode
-
containsGlyph
public boolean containsGlyph(int unicode)
Description copied from class:PdfFont
Check whether font contains glyph with specified unicode.- Overrides:
containsGlyph
in classPdfFont
- Parameters:
unicode
- a unicode code point- Returns:
- true if font contains glyph, represented with the unicode code point, otherwise false.
-
isBuiltInFont
protected boolean isBuiltInFont()
Indicates that the font is built in, i.e. it is one of the 14 Standard fonts- Overrides:
isBuiltInFont
in classPdfSimpleFont<Type1Font>
- Returns:
true
in case the font is a Standard font andfalse
otherwise
-
addFontStream
protected void addFontStream(PdfDictionary fontDescriptor)
If the embedded flag isfalse
or if the font is one of the 14 built in types, it returnsnull
, otherwise the font is read and output in a PdfStream object.- Specified by:
addFontStream
in classPdfSimpleFont<Type1Font>
-
-