gestalt.extension.font
Class FontMetrics

java.lang.Object
  extended by gestalt.extension.font.FontMetrics

public class FontMetrics
extends java.lang.Object


Constructor Summary
FontMetrics()
           
FontMetrics(java.io.InputStream path)
          Constructor.
 
Method Summary
 Vector2f[] getCharacterPositions(char[] chars)
          Returns the character positions calcualted form the char[].
 int getCharacterWidth(char c)
          Returns the advance of an single character, simply called width
 int getFUnitsPerEm()
          Returns the number of fUnits per em, usually 2048 in truetype and 1000 in postscript fonts.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontMetrics

public FontMetrics()

FontMetrics

public FontMetrics(java.io.InputStream path)
Constructor. Requires the TTX file containing the font metrics.

Parameters:
path - String
Method Detail

getFUnitsPerEm

public int getFUnitsPerEm()
Returns the number of fUnits per em, usually 2048 in truetype and 1000 in postscript fonts.

Returns:
int

getCharacterWidth

public int getCharacterWidth(char c)
Returns the advance of an single character, simply called width

Parameters:
c - char
Returns:
int

getCharacterPositions

public Vector2f[] getCharacterPositions(char[] chars)
Returns the character positions calcualted form the char[].

Parameters:
chars - char[]
Returns:
Vector2f[]


processing library gestalt_p5 by Patrick Kochlik + Dennis Paul. (c) 2009