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(String fontname,
FontType subtype,
String basefont,
Object encoding)
create the /Font object
|
Modifier and Type | Method and Description |
---|---|
static PDFFont |
createFont(String fontname,
FontType subtype,
String basefont,
Object encoding)
factory method with the basic parameters
|
PDFName |
getBaseFont()
Returns the name of the BaseFont.
|
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(OutputStream stream)
Write the PDF represention of this object
|
void |
setEncoding(PDFEncoding encoding)
Sets the Encoding value of the font.
|
void |
setEncoding(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, writeDictionary
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFString
public void setEncoding(String encoding)
encoding
- the encodingpublic void setEncoding(PDFEncoding encoding)
encoding
- the encodingpublic void setToUnicode(PDFCMap cmap)
cmap
- the ToUnicode character mappublic static PDFFont createFont(String fontname, FontType subtype, String basefont, 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 String getName()
public PDFName getBaseFont()
protected PDFName getPDFNameForFontType(FontType fontType)
fontType
- font typeprotected void validate()
public int output(OutputStream stream) throws IOException
output
in class PDFDictionary
stream
- the stream to write the PDF toIOException
- if there is an error writing to the streamCopyright © 2022 Apache Software Foundation. All rights reserved.