org.pdfbox.pdmodel.font
Class PDType1Font

java.lang.Object
  extended byorg.pdfbox.pdmodel.font.PDFont
      extended byorg.pdfbox.pdmodel.font.PDSimpleFont
          extended byorg.pdfbox.pdmodel.font.PDType1Font
All Implemented Interfaces:
COSObjectable
Direct Known Subclasses:
PDType1AfmPfbFont

public class PDType1Font
extends PDSimpleFont

This is implementation of the Type1 Font.

Version:
$Revision: 1.11 $
Author:
Ben Litchfield

Field Summary
static PDType1Font COURIER
          Standard Base 14 Font.
static PDType1Font COURIER_BOLD
          Standard Base 14 Font.
static PDType1Font COURIER_BOLD_OBLIQUE
          Standard Base 14 Font.
static PDType1Font COURIER_OBLIQUE
          Standard Base 14 Font.
static PDType1Font HELVETICA
          Standard Base 14 Font.
static PDType1Font HELVETICA_BOLD
          Standard Base 14 Font.
static PDType1Font HELVETICA_BOLD_OBLIQUE
          Standard Base 14 Font.
static PDType1Font HELVETICA_OBLIQUE
          Standard Base 14 Font.
static PDType1Font SYMBOL
          Standard Base 14 Font.
static PDType1Font TIMES_BOLD
          Standard Base 14 Font.
static PDType1Font TIMES_BOLD_ITALIC
          Standard Base 14 Font.
static PDType1Font TIMES_ITALIC
          Standard Base 14 Font.
static PDType1Font TIMES_ROMAN
          Standard Base 14 Font.
static PDType1Font ZAPF_DINGBATS
          Standard Base 14 Font.
 
Fields inherited from class org.pdfbox.pdmodel.font.PDFont
font
 
Constructor Summary
PDType1Font()
          Constructor.
PDType1Font(COSDictionary fontDictionary)
          Constructor.
PDType1Font(String baseFont)
          Constructor.
 
Method Summary
 void drawString(String string, Graphics g, float fontSize, float xScale, float yScale, float x, float y)
          This will draw a string on a canvas using the font.
static String[] getStandard14Names()
          This will get the names of the standard 14 fonts.
static PDType1Font getStandardFont(String name)
          A convenience method to get one of the standard 14 font from name.
 
Methods inherited from class org.pdfbox.pdmodel.font.PDSimpleFont
getAverageFontWidth, getFontBoundingBox, getFontDescriptor, getFontHeight, getFontWidth, getToUnicode, setFontDescriptor, setToUnicode
 
Methods inherited from class org.pdfbox.pdmodel.font.PDFont
clearResources, encode, equals, getAFM, getAverageFontWidthFromAFMFile, getBaseFont, getCodeFromArray, getCOSObject, getEncoding, getFirstChar, getFontMatrix, getFontWidthFromAFMFile, getLastChar, getStringWidth, getSubType, getType, getWidths, hashCode, setBaseFont, setEncoding, setFirstChar, setLastChar, setWidths
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIMES_ROMAN

public static final PDType1Font TIMES_ROMAN
Standard Base 14 Font.


TIMES_BOLD

public static final PDType1Font TIMES_BOLD
Standard Base 14 Font.


TIMES_ITALIC

public static final PDType1Font TIMES_ITALIC
Standard Base 14 Font.


TIMES_BOLD_ITALIC

public static final PDType1Font TIMES_BOLD_ITALIC
Standard Base 14 Font.


HELVETICA

public static final PDType1Font HELVETICA
Standard Base 14 Font.


HELVETICA_BOLD

public static final PDType1Font HELVETICA_BOLD
Standard Base 14 Font.


HELVETICA_OBLIQUE

public static final PDType1Font HELVETICA_OBLIQUE
Standard Base 14 Font.


HELVETICA_BOLD_OBLIQUE

public static final PDType1Font HELVETICA_BOLD_OBLIQUE
Standard Base 14 Font.


COURIER

public static final PDType1Font COURIER
Standard Base 14 Font.


COURIER_BOLD

public static final PDType1Font COURIER_BOLD
Standard Base 14 Font.


COURIER_OBLIQUE

public static final PDType1Font COURIER_OBLIQUE
Standard Base 14 Font.


COURIER_BOLD_OBLIQUE

public static final PDType1Font COURIER_BOLD_OBLIQUE
Standard Base 14 Font.


SYMBOL

public static final PDType1Font SYMBOL
Standard Base 14 Font.


ZAPF_DINGBATS

public static final PDType1Font ZAPF_DINGBATS
Standard Base 14 Font.

Constructor Detail

PDType1Font

public PDType1Font()
Constructor.


PDType1Font

public PDType1Font(COSDictionary fontDictionary)
Constructor.

Parameters:
fontDictionary - The font dictionary according to the PDF specification.

PDType1Font

public PDType1Font(String baseFont)
Constructor.

Parameters:
baseFont - The base font for this font.
Method Detail

getStandardFont

public static PDType1Font getStandardFont(String name)
A convenience method to get one of the standard 14 font from name.

Parameters:
name - The name of the font to get.
Returns:
The font that matches the name or null if it does not exist.

getStandard14Names

public static String[] getStandard14Names()
This will get the names of the standard 14 fonts.

Returns:
An array of the names of the standard 14 fonts.

drawString

public void drawString(String string,
                       Graphics g,
                       float fontSize,
                       float xScale,
                       float yScale,
                       float x,
                       float y)
                throws IOException
This will draw a string on a canvas using the font.

Overrides:
drawString in class PDSimpleFont
Throws:
IOException