org.foray.pdf.object
Class PDFCIDFont

java.lang.Object
  extended by org.foray.pdf.object.PDFObject
      extended by org.foray.pdf.object.PDFCIDFont

public class PDFCIDFont
extends PDFObject

Class representing a "character identifier" font. See PDF Reference, Second Edition, Section 5.6.3.


Nested Class Summary
static class PDFCIDFont.SubType
          Enumeration of possible CID Font sub-types.
 
Field Summary
 
Fields inherited from class org.foray.pdf.object.PDFObject
EOL, MSG_EOL, XREF_EOL
 
Constructor Summary
PDFCIDFont(PDFDocument doc, org.axsl.font.output.FontPdf fsFont, PDFCIDSystemInfo systemInfo, PDFCIDFontDescriptor descriptor)
          Constructor.
 
Method Summary
protected static PDFCIDFont.SubType getCidType(org.axsl.font.output.FontPdf fsFont)
          Finds the CID Font subtype for a given font.
 PDFCIDSystemInfo getSystemInfo()
          Returns the system-info for this font.
 String toPDF()
          Generates the PDF text necessary to represent the object, returning it as a String.
static String widthArrayToPDFString(short[] widthArray)
          Return the PDF String representation of the width array.
 
Methods inherited from class org.foray.pdf.object.PDFObject
bufferToByteArray, byteArrayToStream, getCharsPerLine, getGeneration, getLogger, getNumber, getPDFDocument, output, pdfID, pdfReference, setNumber, stringToByteArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFCIDFont

public PDFCIDFont(PDFDocument doc,
                  org.axsl.font.output.FontPdf fsFont,
                  PDFCIDSystemInfo systemInfo,
                  PDFCIDFontDescriptor descriptor)
Constructor.

Parameters:
doc - The parent PDF document.
fsFont - The encapsulated Font.
systemInfo - The related system info object.
descriptor - The related font descriptor.
Method Detail

toPDF

public String toPDF()
Description copied from class: PDFObject
Generates the PDF text necessary to represent the object, returning it as a String.

Returns:
The PDF text necessary to represent the object.

getCidType

protected static PDFCIDFont.SubType getCidType(org.axsl.font.output.FontPdf fsFont)
Finds the CID Font subtype for a given font.

Parameters:
fsFont - The font for which the CID subtype is needed.
Returns:
The CID Font subtype for fsFont.

widthArrayToPDFString

public static String widthArrayToPDFString(short[] widthArray)
Return the PDF String representation of the width array. See PDF Reference, Second Edition. Section 5.6.3, Subsection entitled "Glyph Metrics in CIDFonts" for an explanation of the contents.

Parameters:
widthArray - The array of integers that should be converted to a /W entry.
Returns:
The String containing the /W entry.

getSystemInfo

public PDFCIDSystemInfo getSystemInfo()
Returns the system-info for this font.

Returns:
Returns the systemInfo.


Copyright © 2017. All rights reserved.