java.lang.Object
org.sejda.sambox.pdmodel.font.TrueTypeEmbedder
org.sejda.sambox.pdmodel.font.PDTrueTypeFontEmbedder
- All Implemented Interfaces:
Subsetter
Embedded PDTrueTypeFont builder. Helper class to populate a PDTrueTypeFont from a TTF.
-
Field Summary
FieldsFields inherited from class org.sejda.sambox.pdmodel.font.TrueTypeEmbedder
cmapLookup, fontDescriptor, ttf -
Constructor Summary
ConstructorsConstructorDescriptionPDTrueTypeFontEmbedder(COSDictionary dict, org.apache.fontbox.ttf.TrueTypeFont ttf, Encoding encoding) Creates a new TrueType font embedder for the given TTF as a PDTrueTypeFont. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildSubset(InputStream ttfSubset, String tag, Map<Integer, Integer> gidToCid) Returns the font's encoding.private voidsetWidths(COSDictionary font, GlyphList glyphList) Sets the glyph widths in the font dictionary.Methods inherited from class org.sejda.sambox.pdmodel.font.TrueTypeEmbedder
addToSubset, buildFontFile2, getFontDescriptor, getTrueTypeFont, needsSubset, subset
-
Field Details
-
fontEncoding
-
-
Constructor Details
-
PDTrueTypeFontEmbedder
PDTrueTypeFontEmbedder(COSDictionary dict, org.apache.fontbox.ttf.TrueTypeFont ttf, Encoding encoding) throws IOException Creates a new TrueType font embedder for the given TTF as a PDTrueTypeFont.- Parameters:
dict- Font dictionaryttf- TTF fontencoding- The PostScript encoding vector to be used for embedding.- Throws:
IOException- if the TTF could not be read
-
-
Method Details
-
setWidths
Sets the glyph widths in the font dictionary.- Throws:
IOException
-
getFontEncoding
Returns the font's encoding. -
buildSubset
protected void buildSubset(InputStream ttfSubset, String tag, Map<Integer, Integer> gidToCid) throws IOException- Specified by:
buildSubsetin classTrueTypeEmbedder- Throws:
IOException
-