gzz.vob
Class TextStyle

java.lang.Object
  |
  +--gzz.vob.TextStyle

public abstract class TextStyle
extends java.lang.Object

A style to draw text in. To get an instance suited for the current graphics API, call gzz.client.GraphicsAPI.getTextStyle()


Field Summary
static java.lang.String rcsid
           
 
Constructor Summary
TextStyle()
           
 
Method Summary
abstract  float getAscent(float scale)
           
abstract  float getDescent(float scale)
           
abstract  float getHeight(float scale)
           
abstract  float getLeading(float scale)
           
 int getOffsetInText(char[] chars, int offs, int len, float scale, float x)
          Return the offset in the string which corresponds to the x coordinate given.
 int getOffsetInText(java.lang.String s, float scale, float x)
          Return the offset in the string which corresponds to the x coordinate given.
abstract  float getScaleByHeight(float h)
          Get the scale to use to get a font in this style of height h.
abstract  float getWidth(char[] chars, int offs, int len, float scale)
           
abstract  float getWidth(java.lang.String s, float scale)
           
 float getX(char[] chars, int offs, int len, float scale, int xoffs)
          Deprecated. Just use getWidth(substring)
 float getX(java.lang.String s, float scale, int offs)
          Deprecated. Just use getWidth(substring)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rcsid

public static final java.lang.String rcsid
See Also:
Constant Field Values
Constructor Detail

TextStyle

public TextStyle()
Method Detail

getScaleByHeight

public abstract float getScaleByHeight(float h)
Get the scale to use to get a font in this style of height h.


getWidth

public abstract float getWidth(java.lang.String s,
                               float scale)

getWidth

public abstract float getWidth(char[] chars,
                               int offs,
                               int len,
                               float scale)

getHeight

public abstract float getHeight(float scale)

getAscent

public abstract float getAscent(float scale)

getDescent

public abstract float getDescent(float scale)

getLeading

public abstract float getLeading(float scale)

getX

public float getX(java.lang.String s,
                  float scale,
                  int offs)
Deprecated. Just use getWidth(substring)

DEPRECATED


getX

public float getX(char[] chars,
                  int offs,
                  int len,
                  float scale,
                  int xoffs)
Deprecated. Just use getWidth(substring)

DEPRECATED


getOffsetInText

public int getOffsetInText(java.lang.String s,
                           float scale,
                           float x)
Return the offset in the string which corresponds to the x coordinate given. 0 = beginning of string, s.length() = end, etc.


getOffsetInText

public int getOffsetInText(char[] chars,
                           int offs,
                           int len,
                           float scale,
                           float x)
Return the offset in the string which corresponds to the x coordinate given. 0 = beginning of string, s.length() = end, etc.