Package org.apache.fop.pdf
Class PDFCIDFont
- java.lang.Object
-
- org.apache.fop.pdf.PDFObject
-
- org.apache.fop.pdf.PDFCIDFont
-
- All Implemented Interfaces:
PDFWritable
public class PDFCIDFont extends PDFObject
Class representing a "character identifier" font (p 210 and onwards).
-
-
Constructor Summary
Constructors Constructor Description PDFCIDFont(java.lang.String basefont, CIDFontType cidtype, int dw, int[] w, java.lang.String registry, java.lang.String ordering, int supplement, PDFCIDFontDescriptor descriptor)
Create the /Font objectPDFCIDFont(java.lang.String basefont, CIDFontType cidtype, int dw, int[] w, PDFCIDSystemInfo systemInfo, PDFCIDFontDescriptor descriptor)
Create the /Font objectPDFCIDFont(java.lang.String basefont, CIDFontType cidtype, int dw, PDFWArray w, PDFCIDSystemInfo systemInfo, PDFCIDFontDescriptor descriptor)
Create the /Font object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
getChildren(java.util.Set<PDFObject> children)
protected java.lang.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 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
setW(PDFWArray w)
Set the /W arrayvoid
setW2(PDFWArray w2)
Set the /W2 arraybyte[]
toPDF()
Encodes the object as a byte array for output to a PDF file.java.lang.String
toPDFString()
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 Detail
-
PDFCIDFont
public PDFCIDFont(java.lang.String basefont, CIDFontType cidtype, int dw, int[] w, java.lang.String registry, java.lang.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(java.lang.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(java.lang.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 Detail
-
setDW
public void setDW(int dw)
Set the /DW attribute- Parameters:
dw
- the default width
-
setW
public void setW(PDFWArray w)
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
public void setCMAP(PDFCMap cmap)
Set the CMap used as /ToUnicode cmap- Parameters:
cmap
- character map
-
setW2
public void setW2(PDFWArray w2)
Set the /W2 array- Parameters:
w2
- array of metrics for vertical writing
-
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"
-
getPDFNameForCIDFontType
protected java.lang.String getPDFNameForCIDFontType(CIDFontType cidFontType)
Returns the PDF name for a certain CID font type.- Parameters:
cidFontType
- CID font type- Returns:
- corresponding PDF name
-
toPDFString
public java.lang.String 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
public void getChildren(java.util.Set<PDFObject> children)
- Overrides:
getChildren
in classPDFObject
-
-