intarsys PDF library API

de.intarsys.pdf.font
Class PDFontType1

java.lang.Object
  extended by de.intarsys.pdf.cos.COSBasedObject
      extended by de.intarsys.pdf.pd.PDObject
          extended by de.intarsys.pdf.font.PDFont
              extended by de.intarsys.pdf.font.PDFontType1
All Implemented Interfaces:
IFont, ICOSObjectListener, IAttributeSupport
Direct Known Subclasses:
PDFontMMType1

public class PDFontType1
extends PDFont
implements IFont

basic implementation for type 1 support


Nested Class Summary
static class PDFontType1.MetaClass
          The meta class implementation
 
Field Summary
static String FONT_Courier
           
static String FONT_Courier_Bold
           
static String FONT_Courier_BoldOblique
           
static String FONT_Courier_Oblique
           
static String FONT_Helvetica
           
static String FONT_Helvetica_Bold
           
static String FONT_Helvetica_BoldOblique
           
static String FONT_Helvetica_Oblique
           
static String FONT_Symbol
           
static String FONT_Times_Bold
           
static String FONT_Times_BoldItalic
           
static String FONT_Times_Italic
           
static String FONT_Times_Roman
           
static String FONT_ZapfDingbats
           
static Map FontAlternatives
          Map of known alternative names for the builtin fonts
static String[] FONTS_STANDARD
           
static PDFontType1.MetaClass META
          The meta class instance
 
Fields inherited from class de.intarsys.pdf.font.PDFont
CN_Subtype_CIDFontType0, CN_Subtype_CIDFontType2, CN_Subtype_MMType1, CN_Subtype_TrueType, CN_Subtype_Type0, CN_Subtype_Type1, CN_Subtype_Type3, CN_Type_Font, DK_BaseFont, DK_Encoding, DK_FirstChar, DK_FontDescriptor, DK_LastChar, DK_Name, DK_ToUnicode, DK_Widths
 
Fields inherited from class de.intarsys.pdf.pd.PDObject
DK_Subtype, DK_Type
 
Method Summary
static PDFontType1 createNew(de.intarsys.font.afm.AFM afm)
          Create a Type1 font from an existing AFM definition.
static PDFontType1 createNew(String name)
          create a Type1 font object to be used in the pdf document
 void embedFontProgram(InputStream is)
           
 de.intarsys.font.afm.AFM getAfm()
           
 String getFontFamilyName()
          The font family name.
 String getFontName()
          The complete font name.
 FontStyle getFontStyle()
          The font style.
 CID getNextCID(byte[] bytes, int offset)
           
 float getUnderlinePosition()
           
 int getUnderlineThickness()
           
 void initializeFromScratchFontDescriptor()
           
 boolean isStandardFont()
          Answer true if this is one of the 14 standard fonts.
 void setAfm(de.intarsys.font.afm.AFM afm)
           
 
Methods inherited from class de.intarsys.pdf.font.PDFont
compress, getBaseFont, getEncoding, getFirstChar, getFontDescriptor, getFontFamilyName, getFontName, getFontStyle, getGlyphWidth, getGlyphWidths, getLastChar, getMacintoshRomanCode, getMissingWidth, getToUnicode, getUnicode, isCharUsed, isEmbedded, isSubset, setBaseFont, setCharUsed, setEncoding, setFontDescriptor, toString
 
Methods inherited from class de.intarsys.pdf.pd.PDObject
cosGetFieldDescendant, cosGetFieldInheritable, cosGetFieldInherited, cosGetSubtype, cosGetType, cosRemoveFieldInheritable, cosSetFieldInheritable, cosSetSubtype, cosSetType, getDoc, getGenericChildren, getGenericParent, setGenericParent
 
Methods inherited from class de.intarsys.pdf.cos.COSBasedObject
changed, cosGetArray, cosGetDict, cosGetDoc, cosGetField, cosGetObject, cosGetStream, cosHasField, cosRemoveField, cosSetField, getAttribute, getFieldBoolean, getFieldDate, getFieldFixed, getFieldFixedArray, getFieldInt, getFieldMLString, getFieldString, invalidateCaches, removeAttribute, setAttribute, setFieldBoolean, setFieldFixed, setFieldInt, setFieldMLString, setFieldName, setFieldObject, setFieldString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FontAlternatives

public static final Map FontAlternatives
Map of known alternative names for the builtin fonts


FONT_Courier

public static String FONT_Courier

FONT_Courier_Bold

public static String FONT_Courier_Bold

FONT_Courier_BoldOblique

public static String FONT_Courier_BoldOblique

FONT_Courier_Oblique

public static String FONT_Courier_Oblique

FONT_Helvetica

public static String FONT_Helvetica

FONT_Helvetica_Bold

public static String FONT_Helvetica_Bold

FONT_Helvetica_BoldOblique

public static String FONT_Helvetica_BoldOblique

FONT_Helvetica_Oblique

public static String FONT_Helvetica_Oblique

FONT_Symbol

public static String FONT_Symbol

FONT_Times_Bold

public static String FONT_Times_Bold

FONT_Times_BoldItalic

public static String FONT_Times_BoldItalic

FONT_Times_Italic

public static String FONT_Times_Italic

FONT_Times_Roman

public static String FONT_Times_Roman

FONT_ZapfDingbats

public static String FONT_ZapfDingbats

FONTS_STANDARD

public static final String[] FONTS_STANDARD

META

public static final PDFontType1.MetaClass META
The meta class instance

Method Detail

createNew

public static PDFontType1 createNew(de.intarsys.font.afm.AFM afm)
Create a Type1 font from an existing AFM definition.

Parameters:
afm - the AFM font definition structure.
Returns:
the new font created

createNew

public static PDFontType1 createNew(String name)
create a Type1 font object to be used in the pdf document

Parameters:
name - the name of the font to use
Returns:
the new font created

embedFontProgram

public void embedFontProgram(InputStream is)

getAfm

public de.intarsys.font.afm.AFM getAfm()

getFontFamilyName

public String getFontFamilyName()
Description copied from interface: IFont
The font family name.

Specified by:
getFontFamilyName in interface IFont
Returns:
The font family name.

getFontName

public String getFontName()
Description copied from interface: IFont
The complete font name.

Specified by:
getFontName in interface IFont
Returns:
The complete font name.

getFontStyle

public FontStyle getFontStyle()
Description copied from interface: IFont
The font style.

Specified by:
getFontStyle in interface IFont
Returns:
The font style.

getNextCID

public CID getNextCID(byte[] bytes,
                      int offset)
Specified by:
getNextCID in class PDFont

getUnderlinePosition

public float getUnderlinePosition()
Specified by:
getUnderlinePosition in class PDFont

getUnderlineThickness

public int getUnderlineThickness()
Specified by:
getUnderlineThickness in class PDFont

initializeFromScratchFontDescriptor

public void initializeFromScratchFontDescriptor()

isStandardFont

public boolean isStandardFont()
Description copied from class: PDFont
Answer true if this is one of the 14 standard fonts. TODO 2 implement

Overrides:
isStandardFont in class PDFont
Returns:
Answer true if this is one of the 14 standard fonts.

setAfm

public void setAfm(de.intarsys.font.afm.AFM afm)

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.