org.apache.fop.pdf
Class PDFFont
- PDFWritable
Class representing a /Font object.
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.
protected String | basefont - the base font name (eg "Helvetica")
|
protected Object | encoding - the character encoding scheme used by the font.
|
protected String | fontname - the internal name for the font (eg "F1")
|
protected FontType | subtype - the font's subtype
(as defined by the constants FontType: TYPE0, TYPE1, MMTYPE1, TYPE3, TRUETYPE)
|
PDFFont(String fontname, FontType subtype, String basefont, Object encoding) - create the /Font object
|
static PDFFont | createFont(String fontname, FontType subtype, String basefont, Object encoding) - factory method with the basic parameters
|
static PDFFont | createFont(String fontname, FontType subtype, String basefont, Object encoding, int firstChar, int lastChar, PDFArray widths, PDFFontDescriptor descriptor) - factory method with the extended parameters
for Type1, MMType1 and TrueType
|
protected void | fillInPDF(StringBuffer target) - This method is called to receive the specifics for the font's subtype.
|
String | getName() - get the internal name used for this font
|
protected String | getPDFNameForFontType(FontType fontType) - Returns the PDF name for a certain font type.
|
String | toPDFString()
|
protected void | validate() - Validates the PDF object prior to serialization.
|
encode , encodeString , encodeText , formatDateTime , formatObject , getDocument , getDocumentSafely , getGeneration , getObjectID , getObjectNumber , hasObjectNumber , makeReference , output , referencePDF , setDocument , setObjectNumber , toInlinePDFString , toPDF , toPDFString |
basefont
protected String basefont
the base font name (eg "Helvetica")
encoding
protected Object encoding
the character encoding scheme used by the font.
It can be a String for standard encodings, or
a PDFEncoding for a more complex scheme, or
a PDFStream containing a CMap in a Type0 font.
If null
then not written out in the PDF.
fontname
protected String fontname
the internal name for the font (eg "F1")
subtype
protected FontType subtype
the font's subtype
(as defined by the constants FontType: TYPE0, TYPE1, MMTYPE1, TYPE3, TRUETYPE)
PDFFont
public PDFFont(String fontname,
FontType subtype,
String basefont,
Object encoding)
create the /Font object
fontname
- the internal name for the fontsubtype
- the font's subtypebasefont
- the base font nameencoding
- the character encoding schema used by the font
createFont
public static PDFFont createFont(String fontname,
FontType subtype,
String basefont,
Object encoding)
factory method with the basic parameters
fontname
- the internal name for the fontsubtype
- the font's subtypebasefont
- the base font nameencoding
- the character encoding schema used by the font
- the generated PDFFont object
createFont
public static PDFFont createFont(String fontname,
FontType subtype,
String basefont,
Object encoding,
int firstChar,
int lastChar,
PDFArray widths,
PDFFontDescriptor descriptor)
factory method with the extended parameters
for Type1, MMType1 and TrueType
fontname
- the internal name for the fontsubtype
- the font's subtypebasefont
- the base font nameencoding
- the character encoding schema used by the fontfirstChar
- the first character code in the fontlastChar
- the last character code in the fontwidths
- an array of size (lastChar - firstChar +1)descriptor
- the descriptor for other font's metrics
- the generated PDFFont object
fillInPDF
protected void fillInPDF(StringBuffer target)
This method is called to receive the specifics for the font's subtype.
The given buffer already contains the fields common to all font types.
target
- the buffer to be completed with the type specific fields
getName
public String getName()
get the internal name used for this font
getPDFNameForFontType
protected String getPDFNameForFontType(FontType fontType)
Returns the PDF name for a certain font type.
- String corresponding PDF name
validate
protected void validate()
Validates the PDF object prior to serialization.
Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.