Package pdf
Class PDFFont
- java.lang.Object
-
- pdf.PDFObject
-
- pdf.PDFFont
-
- All Implemented Interfaces:
java.io.Serializable
public class PDFFont extends PDFObject implements java.io.Serializable
This class defines a font within a PDF document.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class pdf.PDFObject
objser, pdfDocument
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanequals(java.lang.String type, java.lang.String font, int style)This is used by the PDF and PDFPage classes to compare font namesjava.lang.StringgetFont()java.lang.StringgetName()This is the most common method to use.intgetStyle()java.lang.StringgetType()Returns the PDF Type of this objectvoidwrite(java.io.OutputStream os)Writes the object to the output stream.-
Methods inherited from class pdf.PDFObject
getPDFDocument, getSerialID, toArray, toString, writeEnd, writeStart
-
-
-
-
Constructor Detail
-
PDFFont
protected PDFFont()
This constructs a default PDFFont. In this case Helvetica
-
PDFFont
public PDFFont(java.lang.String name, java.lang.String type, java.lang.String font, int style)Constructs a PDFFont. This will attempt to map the font from a known Java font name to that in PDF, defaulting to Helvetica if not possible.- Parameters:
name- The document name, ie /F1type- The pdf type, ie /Type1font- The font name, ie Helveticastyle- The java.awt.Font style, ie: Font.PLAIN
-
-
Method Detail
-
getName
public java.lang.String getName()
This is the most common method to use.- Returns:
- the Font name within the PDF document.
-
getType
public java.lang.String getType()
Description copied from class:PDFObjectReturns the PDF Type of this object
-
getFont
public java.lang.String getFont()
- Returns:
- The PDF Font name
-
getStyle
public int getStyle()
- Returns:
- the font style.
- See Also:
Font
-
write
public void write(java.io.OutputStream os) throws java.io.IOExceptionDescription copied from class:PDFObjectWrites the object to the output stream. This method must be overidden.
Note: It should not write any other objects, even if they are it's Kids, as they will be written by the calling routine.
-
equals
protected boolean equals(java.lang.String type, java.lang.String font, int style)This is used by the PDF and PDFPage classes to compare font names- Parameters:
type- The pdf type, ie /Type1font- The font name, ie Helveticastyle- The java.awt.Font style, ie: Font.PLAIN- Returns:
- true if this object is identical to this font's spec
-
-