Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.font

pack-priv final Class PDTrueTypeFontEmbedder

extends TrueTypeEmbedder
Class Inheritance
Imports
java.io.IOException, .InputStream, java.util.ArrayList, .Collections, .List, .Map, org.apache.fontbox.ttf.HorizontalMetricsTable, .TrueTypeFont, org.apache.pdfbox.cos.COSArray, .COSDictionary, .COSName, org.apache.pdfbox.pdmodel.PDDocument, org.apache.pdfbox.pdmodel.font.encoding.Encoding, .GlyphList

Embedded PDTrueTypeFont builder. Helper class to populate a PDTrueTypeFont from a TTF.
Authors
John Hewson, Ben Litchfield

Field Summary

Modifier and TypeField and Description
private final Encoding
Inherited from org.apache.pdfbox.pdmodel.font.TrueTypeEmbedder:
cmapLookupfontDescriptorttf

Constructor Summary

AccessConstructor and Description
pack-priv
PDTrueTypeFontEmbedder(PDDocument
The parent document
document
,
COSDictionary
Font dictionary
dict
,
TrueTypeFont
TrueType font
ttf
,
Encoding
The PostScript encoding vector to be used for embedding.
encoding
)

Creates a new TrueType font embedder for the given TTF as a PDTrueTypeFont.

Method Summary

Modifier and TypeMethod and Description
protected void
buildSubset(InputStream ttfSubset, String tag, Map<Integer, Integer> gidToCid)

Implements abstract org.apache.pdfbox.pdmodel.font.TrueTypeEmbedder.buildSubset.

Rebuild a font subset.

public Encoding
getFontEncoding()

Returns the font's encoding.

private void
setWidths(COSDictionary font, GlyphList glyphList)

Sets the glyph widths in the font dictionary.

Inherited from org.apache.pdfbox.pdmodel.font.TrueTypeEmbedder:
addGlyphIdsaddToSubsetbuildFontFile2getFontDescriptorgetTagisEmbeddingPermittedneedsSubsetsubset

Field Detail

fontEncodingback to summary
private final Encoding fontEncoding

Constructor Detail

PDTrueTypeFontEmbedderback to summary
pack-priv PDTrueTypeFontEmbedder(PDDocument document, COSDictionary dict, TrueTypeFont ttf, Encoding encoding) throws IOException

Creates a new TrueType font embedder for the given TTF as a PDTrueTypeFont.

Parameters
document:PDDocument

The parent document

dict:COSDictionary

Font dictionary

ttf:TrueTypeFont

TrueType font

encoding:Encoding

The PostScript encoding vector to be used for embedding.

Exceptions
IOException:
if the TTF could not be read

Method Detail

buildSubsetback to summary
protected void buildSubset(InputStream ttfSubset, String tag, Map<Integer, Integer> gidToCid) throws IOException

Implements abstract org.apache.pdfbox.pdmodel.font.TrueTypeEmbedder.buildSubset.

Doc from org.apache.pdfbox.pdmodel.font.TrueTypeEmbedder.buildSubset.

Rebuild a font subset.

Annotations
@Override
getFontEncodingback to summary
public Encoding getFontEncoding()

Returns the font's encoding.

setWidthsback to summary
private void setWidths(COSDictionary font, GlyphList glyphList) throws IOException

Sets the glyph widths in the font dictionary.