org.apache.fop.pdf

Class PDFCIDFont

Implemented Interfaces:
PDFWritable

public class PDFCIDFont
extends PDFObject

Class representing a "character identifier" font (p 210 and onwards).

Field Summary

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

DATE_FORMAT, log

Constructor Summary

PDFCIDFont(String basefont, CIDFontType cidtype, int dw, int[] w, String registry, String ordering, int supplement, PDFCIDFontDescriptor descriptor)
Create the /Font object
PDFCIDFont(String basefont, CIDFontType cidtype, int dw, int[] w, PDFCIDSystemInfo systemInfo, PDFCIDFontDescriptor descriptor)
Create the /Font object
PDFCIDFont(String basefont, CIDFontType cidtype, int dw, PDFWArray w, PDFCIDSystemInfo systemInfo, PDFCIDFontDescriptor descriptor)
Create the /Font object

Method Summary

protected String
getPDFNameForCIDFontType(CIDFontType cidFontType)
Returns the PDF name for a certain CID font type.
void
setCIDMap(PDFStream map)
Set the /CIDToGIDMap (to be used only for CIDFontType2)
void
setCIDMapIdentity()
Set the /CIDToGIDMap (to be used only for CIDFontType2) to "Identity"
void
setCMAP(PDFCMap cmap)
Set the CMap used as /ToUnicode cmap
void
setDW(int dw)
Set the /DW attribute
void
setDW2(int posY, int displacementY)
Set the two elements of the /DW2 array
void
setDW2(int[] dw2)
Set the (two elements) /DW2 array
void
setW(PDFWArray w)
Set the /W array
void
setW2(PDFWArray w2)
Set the /W2 array
String
toPDFString()

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

Constructor Details

PDFCIDFont

public PDFCIDFont(String basefont,
                  CIDFontType cidtype,
                  int dw,
                  int[] w,
                  String registry,
                  String ordering,
                  int supplement,
                  PDFCIDFontDescriptor descriptor)
Create the /Font object
Parameters:
basefont - Name of the basefont
cidtype - CID type
dw - default width
w - array of character widths
registry - name of the issuer
ordering - Unique name of the font
supplement - Supplement number
descriptor - CID font descriptor

PDFCIDFont

public PDFCIDFont(String basefont,
                  CIDFontType cidtype,
                  int dw,
                  int[] w,
                  PDFCIDSystemInfo systemInfo,
                  PDFCIDFontDescriptor descriptor)
Create the /Font object
Parameters:
basefont - Name of the basefont
cidtype - CID type
dw - default width
w - array of character widths
systemInfo - CID system info
descriptor - CID font descriptor

PDFCIDFont

public PDFCIDFont(String basefont,
                  CIDFontType cidtype,
                  int dw,
                  PDFWArray w,
                  PDFCIDSystemInfo systemInfo,
                  PDFCIDFontDescriptor descriptor)
Create the /Font object
Parameters:
basefont - Name of the basefont
cidtype - CID type
dw - default width
w - array of character widths
systemInfo - CID system info
descriptor - CID font descriptor

Method Details

getPDFNameForCIDFontType

protected String getPDFNameForCIDFontType(CIDFontType cidFontType)
Returns the PDF name for a certain CID font type.
Parameters:
cidFontType - CID font type
Returns:
corresponding PDF name

setCIDMap

public void setCIDMap(PDFStream map)
Set the /CIDToGIDMap (to be used only for CIDFontType2)
Parameters:
map - mapping information

setCIDMapIdentity

public void setCIDMapIdentity()
Set the /CIDToGIDMap (to be used only for CIDFontType2) to "Identity"

setCMAP

public void setCMAP(PDFCMap cmap)
Set the CMap used as /ToUnicode cmap
Parameters:
cmap - character map

setDW

public void setDW(int dw)
Set the /DW attribute
Parameters:
dw - the default width

setDW2

public void setDW2(int posY,
                   int displacementY)
Set the two elements of the /DW2 array
Parameters:
posY - position vector
displacementY - displacement vector

setDW2

public void setDW2(int[] dw2)
Set the (two elements) /DW2 array
Parameters:
dw2 - the default metrics for vertical writing

setW

public void setW(PDFWArray w)
Set the /W array
Parameters:
w - the width array

setW2

public void setW2(PDFWArray w2)
Set the /W2 array
Parameters:
w2 - array of metrics for vertical writing

toPDFString

public String toPDFString()
Overrides:
toPDFString in interface PDFObject

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