Package org.apache.fop.pdf
Class PDFCIDFont
java.lang.Object
org.apache.fop.pdf.PDFObject
org.apache.fop.pdf.PDFCIDFont
- All Implemented Interfaces:
PDFWritable
Class representing a "character identifier" font (p 210 and onwards).
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPDFCIDFont
(String basefont, CIDFontType cidtype, int dw, int[] w, String registry, String ordering, int supplement, PDFCIDFontDescriptor descriptor) Create the /Font objectPDFCIDFont
(String basefont, CIDFontType cidtype, int dw, int[] w, PDFCIDSystemInfo systemInfo, PDFCIDFontDescriptor descriptor) Create the /Font objectPDFCIDFont
(String basefont, CIDFontType cidtype, int dw, PDFWArray w, PDFCIDSystemInfo systemInfo, PDFCIDFontDescriptor descriptor) Create the /Font object -
Method Summary
Modifier and TypeMethodDescriptionvoid
getChildren
(Set<PDFObject> children) protected String
getPDFNameForCIDFontType
(CIDFontType cidFontType) Returns the PDF name for a certain CID font type.void
Set the /CIDToGIDMap (to be used only for CIDFontType2)void
Set the /CIDToGIDMap (to be used only for CIDFontType2) to "Identity"void
Set the CMap used as /ToUnicode cmapvoid
setDW
(int dw) Set the /DW attributevoid
setDW2
(int[] dw2) Set the (two elements) /DW2 arrayvoid
setDW2
(int posY, int displacementY) Set the two elements of the /DW2 arrayvoid
Set the /W arrayvoid
Set the /W2 arraybyte[]
toPDF()
Encodes the object as a byte array for output to a PDF file.This method returns a String representation of the PDF object.Methods inherited from class org.apache.fop.pdf.PDFObject
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, output, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent
-
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 basefontcidtype
- CID typedw
- default widthw
- array of character widthsregistry
- name of the issuerordering
- Unique name of the fontsupplement
- Supplement numberdescriptor
- 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 basefontcidtype
- CID typedw
- default widthw
- array of character widthssystemInfo
- CID system infodescriptor
- 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 basefontcidtype
- CID typedw
- default widthw
- array of character widthssystemInfo
- CID system infodescriptor
- CID font descriptor
-
-
Method Details
-
setDW
public void setDW(int dw) Set the /DW attribute- Parameters:
dw
- the default width
-
setW
Set the /W array- Parameters:
w
- the width array
-
setDW2
public void setDW2(int[] dw2) Set the (two elements) /DW2 array- Parameters:
dw2
- the default metrics for vertical writing
-
setDW2
public void setDW2(int posY, int displacementY) Set the two elements of the /DW2 array- Parameters:
posY
- position vectordisplacementY
- displacement vector
-
setCMAP
Set the CMap used as /ToUnicode cmap- Parameters:
cmap
- character map
-
setW2
Set the /W2 array- Parameters:
w2
- array of metrics for vertical writing
-
setCIDMap
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" -
getPDFNameForCIDFontType
Returns the PDF name for a certain CID font type.- Parameters:
cidFontType
- CID font type- Returns:
- corresponding PDF name
-
toPDFString
This method returns a String representation of the PDF object. The result is normally converted/encoded to a byte array by toPDF(). Only use this method to implement the serialization if the object can be fully represented as text. If the PDF representation of the object contains binary content use toPDF() or output(OutputStream) instead. This applies to any object potentially containing a string object because string object are encrypted and therefore need to be binary.- Overrides:
toPDFString
in classPDFObject
- Returns:
- String the String representation
-
toPDF
public byte[] toPDF()Encodes the object as a byte array for output to a PDF file. -
getChildren
- Overrides:
getChildren
in classPDFObject
-