public class PDFFont extends PDFDictionary
A more complete object expressing the base font name and encoding of a font along with an internal name for the font used within streams of content.
Fonts are specified on page 198 and onwards of the PDF 1.3 spec.
entries, order| Constructor and Description |
|---|
PDFFont(java.lang.String fontname,
FontType subtype,
java.lang.String basefont,
java.lang.Object encoding)
create the /Font object
|
| Modifier and Type | Method and Description |
|---|---|
static PDFFont |
createFont(java.lang.String fontname,
FontType subtype,
java.lang.String basefont,
java.lang.Object encoding)
factory method with the basic parameters
|
PDFName |
getBaseFont()
Returns the name of the BaseFont.
|
java.lang.String |
getName()
Get the internal name used for this font.
|
protected PDFName |
getPDFNameForFontType(FontType fontType)
Returns the PDF name for a certain font type.
|
int |
output(java.io.OutputStream stream)
Write the PDF represention of this object
|
void |
setEncoding(PDFEncoding encoding)
Sets the Encoding value of the font.
|
void |
setEncoding(java.lang.String encoding)
Sets the Encoding value of the font.
|
void |
setToUnicode(PDFCMap cmap)
Sets a ToUnicode CMap.
|
protected void |
validate()
Validates the PDF object prior to serialization.
|
containsKey, get, getChildren, getChildren, keySet, put, put, remove, writeDictionarycontentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFStringpublic PDFFont(java.lang.String fontname,
FontType subtype,
java.lang.String basefont,
java.lang.Object encoding)
fontname - the internal name for the fontsubtype - the font's subtypebasefont - the base font nameencoding - the character encoding schema used by the fontpublic void setEncoding(java.lang.String encoding)
encoding - the encodingpublic void setEncoding(PDFEncoding encoding)
encoding - the encodingpublic void setToUnicode(PDFCMap cmap)
cmap - the ToUnicode character mappublic static PDFFont createFont(java.lang.String fontname, FontType subtype, java.lang.String basefont, java.lang.Object encoding)
fontname - the internal name for the fontsubtype - the font's subtypebasefont - the base font nameencoding - the character encoding schema used by the fontpublic java.lang.String getName()
public PDFName getBaseFont()
protected PDFName getPDFNameForFontType(FontType fontType)
fontType - font typeprotected void validate()
public int output(java.io.OutputStream stream)
throws java.io.IOException
output in class PDFDictionarystream - the stream to write the PDF tojava.io.IOException - if there is an error writing to the streamCopyright 1999-2022 The Apache Software Foundation. All Rights Reserved.