org.apache.fop.pdf

Class PDFFontNonBase14

Implemented Interfaces:
PDFWritable
Known Direct Subclasses:
PDFFontTrueType, PDFFontType0, PDFFontType1, PDFFontType3

public abstract class PDFFontNonBase14
extends PDFFont

A common ancestor for Type1, TrueType, MMType1 and Type3 fonts (all except base 14 fonts).

Field Summary

protected PDFFontDescriptor
descriptor
descriptor of font metrics
protected int
firstChar
first character code in the font
protected int
lastChar
last character code in the font
protected PDFArray
widths
widths of characters from firstChar to lastChar

Fields inherited from class org.apache.fop.pdf.PDFFont

basefont, encoding, fontname, subtype

Fields inherited from class org.apache.fop.pdf.PDFObject

DATE_FORMAT, log

Constructor Summary

PDFFontNonBase14(String fontname, FontType subtype, String basefont, Object encoding)
Create the /Font object

Method Summary

protected void
fillInPDF(StringBuffer target)
PDFFontDescriptor
getDescriptor()
void
setDescriptor(PDFFontDescriptor descriptor)
Set the font descriptor (unused for the Type3 fonts)
void
setWidthMetrics(int firstChar, int lastChar, PDFArray widths)
Set the width metrics for the font
protected void
validate()

Methods inherited from class org.apache.fop.pdf.PDFFont

createFont, createFont, fillInPDF, getName, getPDFNameForFontType, toPDFString, validate

Methods inherited from class org.apache.fop.pdf.PDFObject

encode, encodeString, encodeText, formatDateTime, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, hasObjectNumber, makeReference, output, referencePDF, setDocument, setObjectNumber, toInlinePDFString, toPDF, toPDFString

Field Details

descriptor

protected PDFFontDescriptor descriptor
descriptor of font metrics

firstChar

protected int firstChar
first character code in the font

lastChar

protected int lastChar
last character code in the font

widths

protected PDFArray widths
widths of characters from firstChar to lastChar

Constructor Details

PDFFontNonBase14

public PDFFontNonBase14(String fontname,
                        FontType subtype,
                        String basefont,
                        Object encoding)
Create the /Font object
Parameters:
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

Method Details

fillInPDF

protected void fillInPDF(StringBuffer target)
Overrides:
fillInPDF in interface PDFFont

getDescriptor

public PDFFontDescriptor getDescriptor()
Returns:
the FontDescriptor or null if there is none

setDescriptor

public void setDescriptor(PDFFontDescriptor descriptor)
Set the font descriptor (unused for the Type3 fonts)
Parameters:
descriptor - the descriptor for other font's metrics

setWidthMetrics

public void setWidthMetrics(int firstChar,
                            int lastChar,
                            PDFArray widths)
Set the width metrics for the font
Parameters:
firstChar - the first character code in the font
lastChar - the last character code in the font
widths - an array of size (lastChar - firstChar +1)

validate

protected void validate()
Overrides:
validate in interface PDFFont

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.