com.pdftools.expa
Class Font

java.lang.Object
  extended by com.pdftools.NativeLibrary
      extended by com.pdftools.expa.ExpaInitialize
          extended by com.pdftools.expa.Font

public class Font
extends ExpaInitialize


Nested Class Summary
 
Nested classes/interfaces inherited from class com.pdftools.expa.ExpaInitialize
ExpaInitialize.CONTENTOBJECT, ExpaInitialize.ORIENTATION, ExpaInitialize.Rectangle, ExpaInitialize.TransformMatrix
 
Nested classes/interfaces inherited from class com.pdftools.NativeLibrary
NativeLibrary.COLORCONVERSION, NativeLibrary.COLORSPACE, NativeLibrary.COMPRESSION, NativeLibrary.DITHERINGMODE, NativeLibrary.ERRORCODE, NativeLibrary.FONTTYPE, NativeLibrary.PERMISSION, NativeLibrary.RENDEREROPTION, NativeLibrary.RENDERINGMODE, NativeLibrary.ROTATEMODE, NativeLibrary.STRIPTYPE
 
Field Summary
 
Fields inherited from class com.pdftools.NativeLibrary
VERSION
 
Constructor Summary
Font()
           
 
Method Summary
 float getAscent()
          get the Ascent value
 float getAvgWidth()
          get the average with of the glyphs in the font.
 java.lang.String getBaseName()
          get the Basename of the font.
 float[] getBBox()
          get the bounding box as array of four floats.
 float getCapHeight()
          get the height of the top of flat capital letters.
 java.lang.String getCharSet()
          get the list of character names defined in a font subset.
 float getDescent()
          get the Descent value.
 java.lang.String getEncoding(int charIndex)
          get the glyph name of each character
 int getFlags()
          get the flags of the font.
 byte[] getFontFile()
          get a stream that contains a Type1 font program.
 int getFontFileType()
          get the type of the font.
 float getItalicAngle()
          get the counterclockwise angle of the dominant vertical strokes of the font.
 float getLeading()
          get the desired spacing between baselines of consecutive lines of text.
 float getMaxWidth()
          get the maximum with of the glyphs in the font.
 float getMissingWidth()
          get the value for the missing width.
 float getStemH()
          get the vertical thickness of the dominant horizontal stems of the glyphs in the font.
 float getStemV()
          get the horizontal thickness of the dominant vertical stems of the glyphs in the font.
 java.lang.String getType()
          get the type of the font.
 float[] getWidths()
          get the character widths of the font.
 float getXHeight()
          get the maximum height of flat non-ascending lowercase letters
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Font

public Font()
Method Detail

getType

public java.lang.String getType()
get the type of the font.

Returns:
the type of the font.

getBaseName

public java.lang.String getBaseName()
get the Basename of the font.

Returns:
the Basename of the font.

getWidths

public float[] getWidths()
get the character widths of the font.

Returns:
the character widths of the font. there are 256 elements in the array that can directly be indexed with the (unsigned) raw string character number.

getEncoding

public java.lang.String getEncoding(int charIndex)
get the glyph name of each character

Returns:
the glyph name of each character with CharIndex running from 0 to LastChar-FirstChar

getFlags

public int getFlags()
get the flags of the font.

Returns:
the flags of the font. 1 FixedPitch All glyphs have the same width. 2 Serif Glyphs have serifs. 3 Symbolic The font contains characters outside the standard Latin character set. 4 Script Glyphs resemble cursive handwriting. 6 NonSymbolic Font uses standard Latin Characterset or a subset of it. 7 Italic Glyphs are italic. 17 AllCap Font has not lowercase letters. 18 SmallCap Lowercase letters are small uppercase letters. 19 ForceBold If set, bold glyphs are painted bold even at very small text size.

getBBox

public float[] getBBox()
get the bounding box as array of four floats.

Returns:
the bounding box as array of four floats.

getItalicAngle

public float getItalicAngle()
get the counterclockwise angle of the dominant vertical strokes of the font.

Returns:
the counterclockwise angle of the dominant vertical strokes of the font.

getAscent

public float getAscent()
get the Ascent value

Returns:
the Ascent value. This value represents the maximum height above the baseline reached by the glyphs in the font, excluding the height of glyphs for accented characters.

getDescent

public float getDescent()
get the Descent value.

Returns:
the Descent value. This negative number represents the maximum depth below the baseline reached by the glyphs in the font.

getCapHeight

public float getCapHeight()
get the height of the top of flat capital letters.

Returns:
the height of the top of flat capital letters, measured from the baseline.

getStemV

public float getStemV()
get the horizontal thickness of the dominant vertical stems of the glyphs in the font.

Returns:
the horizontal thickness of the dominant vertical stems of the glyphs in the font.

getStemH

public float getStemH()
get the vertical thickness of the dominant horizontal stems of the glyphs in the font.


getAvgWidth

public float getAvgWidth()
get the average with of the glyphs in the font.

Returns:
the average with of the glyphs in the font.

getMaxWidth

public float getMaxWidth()
get the maximum with of the glyphs in the font.

Returns:
the maximum with of the glyphs in the font.

getMissingWidth

public float getMissingWidth()
get the value for the missing width.

Returns:
the value of the width which is used for character codes for which the glyph is missing in the font directory’s Width array.

getCharSet

public java.lang.String getCharSet()
get the list of character names defined in a font subset.

Returns:
a string listing the character names defined in a font subset. This property is only useful for Type1 fonts.

getFontFileType

public int getFontFileType()
get the type of the font.

Returns:
the type of the font.

getFontFile

public byte[] getFontFile()
get a stream that contains a Type1 font program.

Returns:
a stream that contains a Type1 font program.

getLeading

public float getLeading()
get the desired spacing between baselines of consecutive lines of text.

Returns:
the desired spacing between baselines of consecutive lines of text.

getXHeight

public float getXHeight()
get the maximum height of flat non-ascending lowercase letters

Returns:
the maximum height of flat non-ascending lowercase letters (such as the letter x) measured from the baseline.