ElegantJ PDF Library Java API Specification v1.1

com.elegantj.pdf
Class PDFFont

java.lang.Object
  extended bycom.elegantj.pdf.PDFObject
      extended bycom.elegantj.pdf.PDFFont
Direct Known Subclasses:
CJKFont, TrueTypeFont, Type1Font

public class PDFFont
extends PDFObject

This class defines a font within a PDF document


Field Summary
static int BOLD
          Represents the BOLD style
static int BOLDITALIC
          Represents the BOLDITALIC style
static java.lang.String IDENTITY_H
          Represents the encoding
static java.lang.String IDENTITY_V
          Represents the encoding
static int ITALIC
          Represents the ITALIC style
static java.lang.String MACROMAN
          Represents the encoding
static int REGULAR
          Represents the REGULAR style
static java.lang.String WINANSI
          Represents the encoding
 
Method Summary
 float getAscender(float fontSize)
          Returns the maximum height above the baseline reached by characters in this font
 float getBBoxLowerLeftX(float fontSize)
          Returns the fontís bounding box's lower left X coordinate
 float getBBoxLowerLeftY(float fontSize)
          Returns the fontís bounding box's lower left Y coordinate
 float getBBoxUpperRightX(float fontSize)
          Returns the fontís bounding box's upper right X coordinate
 float getBBoxUpperRightY(float fontSize)
          Returns the fontís bounding box's upper right Y coordinate
 float getCapHeight(float fontSize)
          Returns the Y-coordinate of the top of flat capital letters, measured from the baseline
 int getCharWidth(char ch)
          Returns the width of the specified char, normalized to the 1000
 float getCharWidth(char ch, float fontSize)
          Returns the width of the specified char, with specified font size
 float getDescender(float fontSize)
          Returns the maximum depth below the baseline reached by characters in this font Descent is a negative number
 float getItalicAngle()
          Returns the angle in degrees counterclockwise from the vertical of the dominant vertical strokes of the font.
 float getLeading()
          Returns the desired spacing between lines of text
 int getStringWidth(java.lang.String text)
          Returns the width of the specified text, normalized to the 1000
 float getStringWidth(java.lang.String text, float fontSize)
          Returns the width of the specified text, with specified font size
 
Methods inherited from class com.elegantj.pdf.PDFObject
getPDFObjectID, getPDFObjectRefStr, getPDFObjectType, setPDFObjectID, setPDFObjectType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REGULAR

public static int REGULAR
Represents the REGULAR style


BOLD

public static int BOLD
Represents the BOLD style


ITALIC

public static int ITALIC
Represents the ITALIC style


BOLDITALIC

public static int BOLDITALIC
Represents the BOLDITALIC style


WINANSI

public static final java.lang.String WINANSI
Represents the encoding

See Also:
Constant Field Values

MACROMAN

public static final java.lang.String MACROMAN
Represents the encoding

See Also:
Constant Field Values

IDENTITY_H

public static final java.lang.String IDENTITY_H
Represents the encoding

See Also:
Constant Field Values

IDENTITY_V

public static final java.lang.String IDENTITY_V
Represents the encoding

See Also:
Constant Field Values
Method Detail

getCharWidth

public int getCharWidth(char ch)
Returns the width of the specified char, normalized to the 1000

Returns:
The width of the specified char, normalized to the 1000

getCharWidth

public float getCharWidth(char ch,
                          float fontSize)
Returns the width of the specified char, with specified font size

Returns:
The width of the specified char, with specified font size

getStringWidth

public int getStringWidth(java.lang.String text)
Returns the width of the specified text, normalized to the 1000

Returns:
The width of the specified text, normalized to the 1000

getStringWidth

public float getStringWidth(java.lang.String text,
                            float fontSize)
Returns the width of the specified text, with specified font size

Returns:
The width of the specified text, with specified font size

getAscender

public float getAscender(float fontSize)
Returns the maximum height above the baseline reached by characters in this font

Parameters:
fontSize - The specified font size
Returns:
Ascender for the specified font size

getCapHeight

public float getCapHeight(float fontSize)
Returns the Y-coordinate of the top of flat capital letters, measured from the baseline

Parameters:
fontSize - The specified font size
Returns:
CapHeight for the specified font size

getDescender

public float getDescender(float fontSize)
Returns the maximum depth below the baseline reached by characters in this font Descent is a negative number

Parameters:
fontSize - The specified font size
Returns:
Descender for the specified font size

getItalicAngle

public float getItalicAngle()
Returns the angle in degrees counterclockwise from the vertical of the dominant vertical strokes of the font. ItalicAngle is negative for fonts that slope to the right, as almost all italic fonts do


getBBoxLowerLeftX

public float getBBoxLowerLeftX(float fontSize)
Returns the fontís bounding box's lower left X coordinate

Parameters:
fontSize - The specified font size
Returns:
Font Bounding box's lower left X for the specified font size

getBBoxLowerLeftY

public float getBBoxLowerLeftY(float fontSize)
Returns the fontís bounding box's lower left Y coordinate

Parameters:
fontSize - The specified font size
Returns:
Font Bounding box's lower left Y for the specified font size

getBBoxUpperRightX

public float getBBoxUpperRightX(float fontSize)
Returns the fontís bounding box's upper right X coordinate

Parameters:
fontSize - The specified font size
Returns:
Font Bounding box's upper right X for the specified font size

getBBoxUpperRightY

public float getBBoxUpperRightY(float fontSize)
Returns the fontís bounding box's upper right Y coordinate

Parameters:
fontSize - The specified font size
Returns:
Font Bounding box's upper right Y for the specified font size

getLeading

public float getLeading()
Returns the desired spacing between lines of text


ElegantJ PDF Library Java API Specification v1.1

For any feedback, suggestion, or query, please revert back to support@elegantjpdf.com

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjpdf.com
All Rights Reserved.