DynamicPDF by ceTe Software

com.cete.dynamicpdf
Class Font

java.lang.Object
  extended by com.cete.dynamicpdf.Resource
      extended by com.cete.dynamicpdf.Font
Direct Known Subclasses:
CeTeBullets, FormFont, OpenTypeFont, Type1Font

public abstract class Font
extends Resource

Base class from which all fonts are derived.

Licensing:
This class is a DynamicPDF Generator Community Edition feature.


Constructor Summary
protected Font(Encoder encoder)
          Initializes a new instance of the Font class.
protected Font(Encoder encoder, long uid)
          Initializes a new instance of the Font class.
 
Method Summary
abstract  short getAscender()
          Gets the ascender for the font.
 float getAscender(float fontSize)
          Returns the ascender of the font in points for the given font size.
 float getBaseLine(float fontSize, float leading)
          Returns the baseline of the font in points for the given leading and font size.
static Font getCeTeBullets()
          Gets the CeTeBullets font for UnorderedList Bullets.
static Font getCourier()
          Gets the Courier core font with Latin 1 encoding.
static Font getCourierBold()
          Gets the Courier Bold core font with Latin 1 encoding.
static Font getCourierBoldOblique()
          Gets the Courier Bold Oblique core font with Latin 1 encoding.
static Font getCourierOblique()
          Gets the Courier Oblique core font with Latin 1 encoding.
 float getDefaultLeading(float fontSize)
          Returns the default leading of the font in points for the given font size.
abstract  short getDescender()
          Gets the descender for the font.
 float getDescender(float fontSize)
          Returns the descender of the font in points for the given font size.
 Encoder getEncoder()
          Gets the encoder for the font.
 java.lang.String getFormFontName()
          Gets the four character name of the font.
abstract  int getGlyphWidth(char glyph)
          Returns the mwidth of a glyph.
static Font getHanyangSystemsGothicMedium()
          Gets the Hanyang Systems Gothic Medium Korean font.
static Font getHanyangSystemsShinMyeongJoMedium()
          Gets the Hanyang Systems Shin MyeongJo Medium Korean font.
static Font getHeiseiKakuGothicW5()
          Gets the Heisei Kaku Gothic W5 Japanese font.
static Font getHeiseiMinchoW3()
          Gets the Heisei Mincho W3 Japanese font.
static Font getHelvetica()
          Gets the Helvetica core font with Latin 1 encoding.
static Font getHelveticaBold()
          Gets the Helvetica Bold core font with Latin 1 encoding.
static Font getHelveticaBoldOblique()
          Gets the Helvetica Bold Oblique core font with Latin 1 encoding.
static Font getHelveticaOblique()
          Gets the Helvetica Oblique core font with Latin 1 encoding.
 float getKernValue(char left, char right)
          Returns kerning space between two chars.
abstract  LineBreaker getLineBreaker()
          Gets the default line breaker for the font.
 short getLineGap()
          Gets the line gap for the font.
 float getLineGap(float fontSize)
          Returns the line gap of the font in points for the given font size.
static Font getMonotypeHeiMedium()
          Gets the Monotype Hei Medium Chinese (traditional) font.
static Font getMonotypeSungLight()
          Gets the Monotype Sung Light Chinese (traditional) font.
abstract  java.lang.String getName()
          Gets the name of the font.
 ResourceType getResourceType()
          Gets the resource type.
static Font getSinoTypeSongLight()
          Gets the SinoType Song Light Chinese (simplified) font.
static Font getSymbol()
          Gets the Symbol core font.
 TextLineList getTextLines(char[] text, float width, float fontSize)
          Gets the text broken in it lines as TextLineList.
 TextLineList getTextLines(char[] text, float width, float height, float fontSize)
          Gets the text broken in it lines as TextLineList.
 float getTextWidth(char[] text, float fontSize)
          Returns the width of the given text.
 float getTextWidth(java.lang.String text, float fontSize)
          Returns the width of the given text.
static Font getTimesBold()
          Gets the Times Bold core font with Latin 1 encoding.
static Font getTimesBoldItalic()
          Gets the Times Bold Italic core font with Latin 1 encoding.
static Font getTimesItalic()
          Gets the Times Italic core font with Latin 1 encoding.
static Font getTimesRoman()
          Gets the Times Roman core font with Latin 1 encoding.
static Font getZapfDingbats()
          Gets the Zapf Dingbats core font.
 boolean hasKerning()
          Indicates whether the given font is having Kerning pairs or not.
 
Methods inherited from class com.cete.dynamicpdf.Resource
draw, getRequiredPdfObjects, getUid, newUid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Font

protected Font(Encoder encoder,
               long uid)
Initializes a new instance of the Font class.

Parameters:
encoder - Encoder for the font.
uid - long unique id for the font.

Font

protected Font(Encoder encoder)
Initializes a new instance of the Font class.

Parameters:
encoder - Encoder for the font.
Method Detail

getFormFontName

public java.lang.String getFormFontName()
Gets the four character name of the font.

Returns:
Four character name of the font.

getDescender

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

Returns:
short descender for the font.

getDescender

public float getDescender(float fontSize)
Returns the descender of the font in points for the given font size.

Parameters:
fontSize - float font size to use for the calculation.
Returns:
float descender in points.

getAscender

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

Returns:
short ascender for the font.

getLineGap

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

Returns:
short line gap for the font.

getLineBreaker

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

Returns:
LineBreaker default line breaker for the font.

getEncoder

public Encoder getEncoder()
Gets the encoder for the font.

Returns:
Encoder for the font.

getName

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

Returns:
name of the font.

getResourceType

public ResourceType getResourceType()
Gets the resource type.

Overrides:
getResourceType in class Resource
Returns:
the resource type.
See Also:
ResourceType

getGlyphWidth

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

Parameters:
glyph - char Glyph whose mwidth is to be returned.
Returns:
int Mwidth of glyph.

getTextLines

public TextLineList getTextLines(char[] text,
                                 float width,
                                 float height,
                                 float fontSize)
Gets the text broken in it lines as TextLineList.

Parameters:
text - Character array containing the text.
width - Width to use when calculating the text lines.
height - Height to use when calculating the text lines.
fontSize - Font size to use when calculating the text lines.
Returns:
the text line list.
See Also:
TextLineList

getTextLines

public TextLineList getTextLines(char[] text,
                                 float width,
                                 float fontSize)
Gets the text broken in it lines as TextLineList.

Parameters:
text - Character array containing the text.
width - Width to use when calculating the text lines.
fontSize - Font size to use when calculating the text lines.
Returns:
the text line list.
See Also:
TextLineList

getTextWidth

public float getTextWidth(char[] text,
                          float fontSize)
Returns the width of the given text.

Parameters:
text - char[] array or text whose width is returned.
fontSize - float font size of text.
Returns:
float width of text in points.

getTextWidth

public float getTextWidth(java.lang.String text,
                          float fontSize)
Returns the width of the given text.

Parameters:
text - String text whose width is returned.
fontSize - float font size of text.
Returns:
float width of text in points.

getAscender

public float getAscender(float fontSize)
Returns the ascender of the font in points for the given font size.

Parameters:
fontSize - float font size to use for the calculation.
Returns:
float ascender in points.

getLineGap

public float getLineGap(float fontSize)
Returns the line gap of the font in points for the given font size.

Parameters:
fontSize - float font size to use for the calculation.
Returns:
float line gap in points.

getDefaultLeading

public float getDefaultLeading(float fontSize)
Returns the default leading of the font in points for the given font size.

Parameters:
fontSize - float font size to use for the calculation.
Returns:
float default leading in points.

getBaseLine

public float getBaseLine(float fontSize,
                         float leading)
Returns the baseline of the font in points for the given leading and font size.

Parameters:
fontSize - float font size to use for the calculation.
leading - float leading to use for the calculation.
Returns:
float baseline in points.

hasKerning

public boolean hasKerning()
Indicates whether the given font is having Kerning pairs or not.

Returns:
Bool indicating presence of kern pairs.

getKernValue

public float getKernValue(char left,
                          char right)
Returns kerning space between two chars.

Parameters:
left - Char in left side of the pair.
right - Char in the right side of the pair.
Returns:
Kerning space between the given chars.

getTimesRoman

public static Font getTimesRoman()
Gets the Times Roman core font with Latin 1 encoding.

Returns:
Times Roman core font with Latin 1 encoding.

getTimesBold

public static Font getTimesBold()
Gets the Times Bold core font with Latin 1 encoding.

Returns:
Times Bold core font with Latin 1 encoding.

getTimesItalic

public static Font getTimesItalic()
Gets the Times Italic core font with Latin 1 encoding.

Returns:
Times Italic core font with Latin 1 encoding.

getTimesBoldItalic

public static Font getTimesBoldItalic()
Gets the Times Bold Italic core font with Latin 1 encoding.

Returns:
Times Bold Italic core font with Latin 1 encoding.

getHelvetica

public static Font getHelvetica()
Gets the Helvetica core font with Latin 1 encoding.

Returns:
Helvetica core font with Latin 1 encoding.

getHelveticaBold

public static Font getHelveticaBold()
Gets the Helvetica Bold core font with Latin 1 encoding.

Returns:
Helvetica Bold core font with Latin 1 encoding.

getHelveticaOblique

public static Font getHelveticaOblique()
Gets the Helvetica Oblique core font with Latin 1 encoding.

Returns:
Helvetica Oblique core font with Latin 1 encoding.

getHelveticaBoldOblique

public static Font getHelveticaBoldOblique()
Gets the Helvetica Bold Oblique core font with Latin 1 encoding.

Returns:
Helvetica Bold Oblique core font with Latin 1 encoding.

getCourier

public static Font getCourier()
Gets the Courier core font with Latin 1 encoding.

Returns:
Courier core font with Latin 1 encoding.

getCourierBold

public static Font getCourierBold()
Gets the Courier Bold core font with Latin 1 encoding.

Returns:
Courier Bold core font with Latin 1 encoding.

getCourierOblique

public static Font getCourierOblique()
Gets the Courier Oblique core font with Latin 1 encoding.

Returns:
Courier Oblique core font with Latin 1 encoding.

getCourierBoldOblique

public static Font getCourierBoldOblique()
Gets the Courier Bold Oblique core font with Latin 1 encoding.

Returns:
Courier Bold Oblique core font with Latin 1 encoding.

getSymbol

public static Font getSymbol()
Gets the Symbol core font.

Returns:
Symbol core font.

getZapfDingbats

public static Font getZapfDingbats()
Gets the Zapf Dingbats core font.

Returns:
Zapf Dingbats core font.

getHeiseiKakuGothicW5

public static Font getHeiseiKakuGothicW5()
Gets the Heisei Kaku Gothic W5 Japanese font.

Returns:
Heisei Kaku Gothic W5 Japanese font.

getHeiseiMinchoW3

public static Font getHeiseiMinchoW3()
Gets the Heisei Mincho W3 Japanese font.

Returns:
Heisei Mincho W3 Japanese font.

getHanyangSystemsGothicMedium

public static Font getHanyangSystemsGothicMedium()
Gets the Hanyang Systems Gothic Medium Korean font.

Returns:
Hanyang Systems Gothic Medium Korean font.

getHanyangSystemsShinMyeongJoMedium

public static Font getHanyangSystemsShinMyeongJoMedium()
Gets the Hanyang Systems Shin MyeongJo Medium Korean font.

Returns:
Hanyang Systems Shin MyeongJo Medium Korean font.

getMonotypeHeiMedium

public static Font getMonotypeHeiMedium()
Gets the Monotype Hei Medium Chinese (traditional) font.

Returns:
Monotype Hei Medium Chinese (traditional) font.

getMonotypeSungLight

public static Font getMonotypeSungLight()
Gets the Monotype Sung Light Chinese (traditional) font.

Returns:
Monotype Sung Light Chinese (traditional) font.

getSinoTypeSongLight

public static Font getSinoTypeSongLight()
Gets the SinoType Song Light Chinese (simplified) font.

Returns:
SinoType Song Light Chinese (simplified) font.

getCeTeBullets

public static Font getCeTeBullets()
Gets the CeTeBullets font for UnorderedList Bullets.

Returns:
CeTeBullets font.

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.04 for Java generated on September 25, 2019
© Copyright 2019, ceTe Software