org.apache.fop.pdf
Class PDFFont

org.apache.fop.pdf.PDFObject
  |
  +--org.apache.fop.pdf.PDFFont
Direct Known Subclasses:
PDFFontNonBase14

public class PDFFont
extends PDFObject

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.


Field Summary
 final static byteMMTYPE1
          font subtype to be used as parameter to createFont()
 final static byteTRUETYPE
          font subtype to be used as parameter to createFont()
 final static byteTYPE0
          font subtype to be used as parameter to createFont()
 final static byteTYPE1
          font subtype to be used as parameter to createFont()
 final static byteTYPE3
          font subtype to be used as parameter to createFont()

Constructor Summary
PDFFont(int number, String fontname, byte subtype, String basefont, Object encoding)
          create the /Font object

Method Summary
 static PDFFontcreateFont(int number, String fontname, byte subtype, String basefont, Object encoding)
          factory method with the basic parameters
 static PDFFontcreateFont(int number, String fontname, byte subtype, String basefont, Object encoding, int firstChar, int lastChar, PDFArray widths, PDFFontDescriptor descriptor)
          factory method with the extended parameters for Type1, MMType1 and TrueType
 StringgetName()
          get the internal name used for this font
 byte[]toPDF()
          produce the PDF representation for the object

Methods inherited from class org.apache.fop.pdf.PDFObject
getNumber, referencePDF

Field Detail

MMTYPE1

public final static byte MMTYPE1
font subtype to be used as parameter to createFont()

TRUETYPE

public final static byte TRUETYPE
font subtype to be used as parameter to createFont()

TYPE0

public final static byte TYPE0
font subtype to be used as parameter to createFont()

TYPE1

public final static byte TYPE1
font subtype to be used as parameter to createFont()

TYPE3

public final static byte TYPE3
font subtype to be used as parameter to createFont()
Constructor Detail

PDFFont

public PDFFont(int number, String fontname, byte subtype, String basefont, Object encoding)
create the /Font object
Parameters:
number - the object's number
fontname - the internal name for the font
subtype - the font's subtype
basefont - the base font name
encoding - the character encoding schema used by the font
mapping - the Unicode mapping mechanism
Method Detail

createFont

public static PDFFont createFont(int number, String fontname, byte subtype, String basefont, Object encoding)
factory method with the basic parameters
Parameters:
number - the object's number
fontname - the internal name for the font
subtype - the font's subtype
basefont - the base font name
encoding - the character encoding schema used by the font

createFont

public static PDFFont createFont(int number, String fontname, byte subtype, String basefont, Object encoding, int firstChar, int lastChar, PDFArray widths, PDFFontDescriptor descriptor)
factory method with the extended parameters for Type1, MMType1 and TrueType
Parameters:
number - the object's number
fontname - the internal name for the font
subtype - the font's subtype
basefont - the base font name
encoding - the character encoding schema used by the font
firstChar - the first character code in the font
lastChar - the last character code in the font
widths - an array of size (lastChar - firstChar +1)
descriptor - the descriptor for other font's metrics

getName

public String getName()
get the internal name used for this font
Returns: the internal name

toPDF

public byte[] toPDF()
produce the PDF representation for the object
Returns: the PDF

Association Links

to Class java.lang.String

font subtype names as output in the PDF

to Class java.lang.String

the internal name for the font (eg "F1")

to Class java.lang.String

the base font name (eg "Helvetica")