ElegantJ PDF Library Java API Specification v1.1

com.elegantj.pdf
Class CJKFont

java.lang.Object
  extended bycom.elegantj.pdf.PDFObject
      extended bycom.elegantj.pdf.PDFFont
          extended bycom.elegantj.pdf.CJKFont

public class CJKFont
extends PDFFont

CJKFont provides the CJKFont/Type0 font for the PDF Using this class one can use builtin fonts like Chinese, Japanese and Korean


Field Summary
static int HEISEIKAKUGO_W5
          The font, Represent the HeiseiIkakugo_W5 Japanese font
static int HEISEIMIN_W3
          The font, Represent the HeiseiMin_W3 Japanese font
static int HYGOTHIC_MEDIUM
          The font, Represent the HYGoThic_Medium Korean font
static int HYSMYEONGJO_MEDIUM
          The font, Represent the HYSMyeongJo_Medium Korean font
static int HYSMYEONGJOSTD_MEDIUM
          The font, Represent the HYSMyeongJoStd_Medium Korean font
static int KOZMINPRO_REGULAR
          The font, Represent the KozMinPro_Regular Japanese font
static int MHEI_MEDIUM
          The font, Represent the MHei_Medium Chinese font
static int MSUNG_LIGHT
          The font, Represent the MSung_Light Chinese font
static int MSUNGSTD_LIGHT
          The font, Represent the MSungStd_Light Chinese font
static int STSONG_LIGHT
          The font, Represent the STSONG_LIGHT Chinese font
static int STSONGSTD_LIGHT
          The font, Represent the STSongStd_Light Chinese font
 
Fields inherited from class com.elegantj.pdf.PDFFont
BOLD, BOLDITALIC, IDENTITY_H, IDENTITY_V, ITALIC, MACROMAN, REGULAR, WINANSI
 
Constructor Summary
CJKFont(int font, int style)
          Constructs the CJKFont from the specified font, style
 
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
 char getCIDCode(char c)
          Returns the CID code of the specified char
 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.PDFFont
getCharWidth, getCharWidth
 
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

HEISEIMIN_W3

public static final int HEISEIMIN_W3
The font, Represent the HeiseiMin_W3 Japanese font

See Also:
Constant Field Values

HEISEIKAKUGO_W5

public static final int HEISEIKAKUGO_W5
The font, Represent the HeiseiIkakugo_W5 Japanese font

See Also:
Constant Field Values

KOZMINPRO_REGULAR

public static final int KOZMINPRO_REGULAR
The font, Represent the KozMinPro_Regular Japanese font

See Also:
Constant Field Values

STSONG_LIGHT

public static final int STSONG_LIGHT
The font, Represent the STSONG_LIGHT Chinese font

See Also:
Constant Field Values

STSONGSTD_LIGHT

public static final int STSONGSTD_LIGHT
The font, Represent the STSongStd_Light Chinese font

See Also:
Constant Field Values

MHEI_MEDIUM

public static final int MHEI_MEDIUM
The font, Represent the MHei_Medium Chinese font

See Also:
Constant Field Values

MSUNG_LIGHT

public static final int MSUNG_LIGHT
The font, Represent the MSung_Light Chinese font

See Also:
Constant Field Values

MSUNGSTD_LIGHT

public static final int MSUNGSTD_LIGHT
The font, Represent the MSungStd_Light Chinese font

See Also:
Constant Field Values

HYGOTHIC_MEDIUM

public static final int HYGOTHIC_MEDIUM
The font, Represent the HYGoThic_Medium Korean font

See Also:
Constant Field Values

HYSMYEONGJO_MEDIUM

public static final int HYSMYEONGJO_MEDIUM
The font, Represent the HYSMyeongJo_Medium Korean font

See Also:
Constant Field Values

HYSMYEONGJOSTD_MEDIUM

public static final int HYSMYEONGJOSTD_MEDIUM
The font, Represent the HYSMyeongJoStd_Medium Korean font

See Also:
Constant Field Values
Constructor Detail

CJKFont

public CJKFont(int font,
               int style)
        throws java.lang.Exception,
               java.io.IOException
Constructs the CJKFont from the specified font, style

Parameters:
font - The specified font
style - The specified style
Method Detail

getStringWidth

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

Overrides:
getStringWidth in class PDFFont
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

Overrides:
getStringWidth in class PDFFont
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

Overrides:
getAscender in class PDFFont
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

Overrides:
getCapHeight in class PDFFont
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

Overrides:
getDescender in class PDFFont
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

Overrides:
getItalicAngle in class PDFFont

getBBoxLowerLeftX

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

Overrides:
getBBoxLowerLeftX in class PDFFont
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

Overrides:
getBBoxLowerLeftY in class PDFFont
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

Overrides:
getBBoxUpperRightX in class PDFFont
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

Overrides:
getBBoxUpperRightY in class PDFFont
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

Overrides:
getLeading in class PDFFont

getCIDCode

public char getCIDCode(char c)
Returns the CID code of the specified char

Parameters:
c - The specified char
Returns:
The CID code of the specified char

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.