org.jtgl.core
Class JTGLFont

java.lang.Object
  extended by org.jtgl.core.JTGLFont

public abstract class JTGLFont
extends java.lang.Object

Represents a Font used in text rendering.

Author:
Manuel Polo (manuel_polo at yahoo dot es)

Field Summary
static int SIZE_LARGE
           
static int SIZE_MEDIUM
           
static int SIZE_SMALL
           
static int STYLE_BOLD
           
static int STYLE_ITALIC
           
static int STYLE_PLAIN
           
static int STYLE_UNDERLINED
           
 
Constructor Summary
protected JTGLFont()
          Creates a new instance of JTGLFont
 
Method Summary
abstract  int charWidth(char ch)
           
 JTGLFont createFont(int style)
           
 JTGLFont createFont(java.lang.String name)
           
 JTGLFont createFont(java.lang.String name, int style)
           
abstract  JTGLFont createFont(java.lang.String name, int style, int size)
           
abstract  java.lang.String[] getAvailableFontNames()
           
abstract  JTGLFont getDefaultFont()
           
abstract  int getHeight()
           
 java.lang.String getName()
           
abstract  java.lang.Object getNativeFont()
           
 int getSize()
           
 int[] getSizes()
           
 int getStyle()
           
protected  void init(java.lang.String name, int style, int size)
           
 boolean isBold()
           
 boolean isItalic()
           
 boolean isPlain()
           
 boolean isUnderlined()
           
 int stringWidth(java.lang.String str)
           
abstract  int stringWidth(java.lang.String str, int offset, int length)
           
 java.lang.String toString()
           
protected  int translateToJTGLStyle(int nativeStyle)
           
protected  int translateToNativeStyle(int style)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIZE_SMALL

public static final int SIZE_SMALL
See Also:
Constant Field Values

SIZE_MEDIUM

public static final int SIZE_MEDIUM
See Also:
Constant Field Values

SIZE_LARGE

public static final int SIZE_LARGE
See Also:
Constant Field Values

STYLE_PLAIN

public static final int STYLE_PLAIN
See Also:
Constant Field Values

STYLE_BOLD

public static final int STYLE_BOLD
See Also:
Constant Field Values

STYLE_ITALIC

public static final int STYLE_ITALIC
See Also:
Constant Field Values

STYLE_UNDERLINED

public static final int STYLE_UNDERLINED
See Also:
Constant Field Values
Constructor Detail

JTGLFont

protected JTGLFont()
Creates a new instance of JTGLFont

Method Detail

init

protected void init(java.lang.String name,
                    int style,
                    int size)

getName

public java.lang.String getName()

getStyle

public int getStyle()

getSize

public int getSize()

isPlain

public boolean isPlain()

isBold

public boolean isBold()

isItalic

public boolean isItalic()

isUnderlined

public boolean isUnderlined()

stringWidth

public int stringWidth(java.lang.String str)

getSizes

public int[] getSizes()

getHeight

public abstract int getHeight()

charWidth

public abstract int charWidth(char ch)

stringWidth

public abstract int stringWidth(java.lang.String str,
                                int offset,
                                int length)

getAvailableFontNames

public abstract java.lang.String[] getAvailableFontNames()

getNativeFont

public abstract java.lang.Object getNativeFont()

getDefaultFont

public abstract JTGLFont getDefaultFont()

createFont

public JTGLFont createFont(java.lang.String name)

createFont

public JTGLFont createFont(int style)

createFont

public JTGLFont createFont(java.lang.String name,
                           int style)

createFont

public abstract JTGLFont createFont(java.lang.String name,
                                    int style,
                                    int size)

translateToJTGLStyle

protected int translateToJTGLStyle(int nativeStyle)

translateToNativeStyle

protected int translateToNativeStyle(int style)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object