gestalt.extension.font
Class TextLine

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

public class TextLine
extends java.lang.Object


Constructor Summary
TextLine(FontMetrics metrics, java.awt.Font theFont)
          Constructor.
 
Method Summary
 float[] getBounds()
          Returns the width and height of the whole line in pixels
 Vector2f[] getCharacterPositions()
          Returns the character positions of the stored text in pixels
 java.awt.Font getFont()
           
 float getFontSize()
           
 Vector2f[] getFUnitCharacterPositions()
          Returns the character positions of the stored text.
 float getFUnitPixelSize()
           
 FontMetrics getMetrics()
           
 char[] getTextCharacters()
          Returns the stored text.
 java.lang.String getTextString()
          Returns the stored text.
 float getTracking()
          Returns the current tracking value in 1/1000 em.
 void setFontSize(float pointSize)
           
 void setMetrics(FontMetrics metrics)
           
 void setTabList(float[] theTabList)
           
 void setText(char[] chars)
          Set the text to be calculated.
 void setText(java.lang.String string)
          Set the text to be calculated.
 void setTracking(float tracking)
          Set tracking in 1/1000 em, a unit of measure that is relative to the current type size.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextLine

public TextLine(FontMetrics metrics,
                java.awt.Font theFont)
Constructor. Sets default font. Requires font metrics.

Parameters:
metrics - TypoMetrics
Method Detail

getFont

public java.awt.Font getFont()

setTabList

public void setTabList(float[] theTabList)

setFontSize

public void setFontSize(float pointSize)

getFontSize

public float getFontSize()

setMetrics

public void setMetrics(FontMetrics metrics)

getMetrics

public FontMetrics getMetrics()

getFUnitPixelSize

public float getFUnitPixelSize()

setTracking

public void setTracking(float tracking)
Set tracking in 1/1000 em, a unit of measure that is relative to the current type size. In a 6-point font, 1 em equals 6 points; tracking are strictly proportional to the current type size. Works exactly like in Adobe InDesign.

Parameters:
tracking - int

getTracking

public float getTracking()
Returns the current tracking value in 1/1000 em.

Returns:
int

setText

public void setText(char[] chars)
Set the text to be calculated.

Parameters:
chars - char[]

setText

public void setText(java.lang.String string)
Set the text to be calculated.

Parameters:
string - String

getTextCharacters

public char[] getTextCharacters()
Returns the stored text.

Returns:
char[]

getTextString

public java.lang.String getTextString()
Returns the stored text.

Returns:
char[]

getFUnitCharacterPositions

public Vector2f[] getFUnitCharacterPositions()
Returns the character positions of the stored text.

Returns:
Vector2f[]

getCharacterPositions

public Vector2f[] getCharacterPositions()
Returns the character positions of the stored text in pixels

Returns:
Vector2f[]

getBounds

public float[] getBounds()
Returns the width and height of the whole line in pixels

Returns:
float[]


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