DynamicPDF by ceTe Software

com.cete.dynamicpdf.text
Class TrueTypeFont

java.lang.Object
  |
  +--com.cete.dynamicpdf.Resource
        |
        +--com.cete.dynamicpdf.Font
              |
              +--com.cete.dynamicpdf.text.TrueTypeFont
All Implemented Interfaces:
IFontSubsettable

public class TrueTypeFont
extends Font
implements IFontSubsettable

Represents a TrueType font.

Licensing:
This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:


Constructor Summary
TrueTypeFont(byte[] bytes)
          Initializes a new instance of the TrueTypeFont class.
TrueTypeFont(byte[] bytes, LineBreaker lineBreaker)
          Initializes a new instance of the TrueTypeFont class.
TrueTypeFont(java.lang.String filePath)
          Initializes a new instance of the TrueTypeFont class.
TrueTypeFont(java.lang.String filePath, LineBreaker lineBreaker)
          Initializes a new instance of the TrueTypeFont class.
 
Method Summary
 void draw(DocumentWriter writer)
          Draws the TrueType font to the given DocumentWriter object.
 short getAscender()
          Gets the ascender for the font.
 short getDescender()
          Gets the descender for the font.
 boolean getEmbed()
          Gets a value indicating if the font should be embedded.
 FontSubsetter getFontSubsetter()
          Returns a font subsetter for the TrueType font.
 int getGlyphWidth(char glyph)
          Returns the mwidth of a glyph.
 LineBreaker getLineBreaker()
          Gets the default line breaker for the font.
 short getLineGap()
          Gets the line gap for the font.
 java.lang.String getName()
          Gets the name of the font.
 int getRequiredPdfObjects()
          Gets the number of PDF objects required by the TrueType font.
 void setEmbed(boolean value)
          Sets a value indicating if the font should be embedded.
 
Methods inherited from class com.cete.dynamicpdf.Font
getAscender, getBaseLine, getCeTeBullets, getCourier, getCourierBold, getCourierBoldOblique, getCourierOblique, getDefaultLeading, getDescender, getEncoder, getHanyangSystemsGothicMedium, getHanyangSystemsShinMyeongJoMedium, getHeiseiKakuGothicW5, getHeiseiMinchoW3, getHelvetica, getHelveticaBold, getHelveticaBoldOblique, getHelveticaOblique, getLineGap, getMonotypeHeiMedium, getMonotypeSungLight, getResourceType, getSinoTypeSongLight, getSymbol, getTextLines, getTextLines, getTextWidth, getTextWidth, getTimesBold, getTimesBoldItalic, getTimesItalic, getTimesRoman, getZapfDingbats
 
Methods inherited from class com.cete.dynamicpdf.Resource
getUid, newUid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrueTypeFont

public TrueTypeFont(java.lang.String filePath)
Initializes a new instance of the TrueTypeFont class.

Parameters:
filePath - Physical file path to the TrueType font file.

TrueTypeFont

public TrueTypeFont(byte[] bytes)
Initializes a new instance of the TrueTypeFont class.

Parameters:
bytes - TrueType font byte array.

TrueTypeFont

public TrueTypeFont(byte[] bytes,
                    LineBreaker lineBreaker)
Initializes a new instance of the TrueTypeFont class.

Parameters:
bytes - TrueType font file byte array.
lineBreaker - Line breaker to use for the TrueType font.
See Also:
LineBreaker

TrueTypeFont

public TrueTypeFont(java.lang.String filePath,
                    LineBreaker lineBreaker)
Initializes a new instance of the TrueTypeFont class.

Parameters:
filePath - Physical file path to the TrueType font file.
lineBreaker - Line breaker to use for the TrueType font.
See Also:
LineBreaker
Method Detail

getRequiredPdfObjects

public int getRequiredPdfObjects()
Gets the number of PDF objects required by the TrueType font.

Overrides:
getRequiredPdfObjects in class Resource
Returns:
Number of PDF objects required by the TrueType font.

getDescender

public short getDescender()
Gets the descender for the font.

Specified by:
getDescender in class Font
Returns:
The descender for the font.

getAscender

public short getAscender()
Gets the ascender for the font.

Specified by:
getAscender in class Font
Returns:
The ascender for the font.

getLineGap

public short getLineGap()
Gets the line gap for the font.

Overrides:
getLineGap in class Font
Returns:
the line gap for the font.

getName

public java.lang.String getName()
Gets the name of the font.

Specified by:
getName in class Font
Returns:
the name of the font.

getEmbed

public boolean getEmbed()
Gets a value indicating if the font should be embedded.


setEmbed

public void setEmbed(boolean value)
Sets a value indicating if the font should be embedded.


getLineBreaker

public LineBreaker getLineBreaker()
Gets the default line breaker for the font.

Specified by:
getLineBreaker in class Font
Returns:
the default line breaker for the font.

draw

public void draw(DocumentWriter writer)
Draws the TrueType font to the given DocumentWriter object.

Specified by:
draw in class Resource
Parameters:
writer - DocumentWriter object to receive the TrueType font's output.
See Also:
DocumentWriter

getGlyphWidth

public int getGlyphWidth(char glyph)
Returns the mwidth of a glyph.

Specified by:
getGlyphWidth in class Font
Parameters:
glyph - Glyph whose mwidth is to be returned.
Returns:
Mwidth of glyph.

getFontSubsetter

public FontSubsetter getFontSubsetter()
Returns a font subsetter for the TrueType font.

Specified by:
getFontSubsetter in interface IFontSubsettable
Returns:
FontSubsetter object to use for the font.
See Also:
FontSubsetter

DynamicPDF by ceTe Software

API Reference for DynamicPDFTM v4.0.3 for Java generated on March 22, 2007
© Copyright 2007, ceTe Software