iicm.utils3d
Class Font3D

java.lang.Object
  |
  +--iicm.utils3d.Font3D

public class Font3D
extends java.lang.Object

Font3D - Fonts for GE3D Copyright (c) 1996, 1998 IICM


Field Summary
 float[] charwidth_
           
 FloatArray[] glyphs_
           
 float hspacing_
           
 
Constructor Summary
Font3D(java.lang.String font_url, float hspacing)
          Stard constructor
 
Method Summary
 void drawAsciiString(java.lang.String text, float[] origin, float size, boolean italic, boolean bold, float hspacing)
          Draws a String in 3D.
 float getHSpaceing()
           
 float getStringWidth(java.lang.String text)
           
protected  void loadFont(java.net.URL url)
          Loads the the font data from the given URL.
 void setFont(java.lang.String font_url, float hspacing)
          Sets a new 3D font.
 void setHSpaceing(float hspacing)
          Sets the horizontal space between two characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

charwidth_

public float[] charwidth_

glyphs_

public FloatArray[] glyphs_

hspacing_

public float hspacing_
Constructor Detail

Font3D

public Font3D(java.lang.String font_url,
              float hspacing)
       throws java.net.MalformedURLException,
              java.io.IOException
Stard constructor
Parameters:
font_url - The URL of the font definition file (a *.gjf file)
hspacing - The horizontal space between two characters.
Method Detail

setFont

public void setFont(java.lang.String font_url,
                    float hspacing)
             throws java.net.MalformedURLException,
                    java.io.IOException
Sets a new 3D font.
Parameters:
font_url - The URL of the font definition file (a *.gjf file)
hspacing - The horizontal space between two characters.

getHSpaceing

public float getHSpaceing()

setHSpaceing

public void setHSpaceing(float hspacing)
Sets the horizontal space between two characters.
Parameters:
hspacing - The new horizontal space between two characters.

getStringWidth

public float getStringWidth(java.lang.String text)
Returns:
The width of the String in the 3D space, with the current Font.

drawAsciiString

public void drawAsciiString(java.lang.String text,
                            float[] origin,
                            float size,
                            boolean italic,
                            boolean bold,
                            float hspacing)
Draws a String in 3D.
Parameters:
text - The text to draw.
origin - The text origin in world coordinates.
size - The size (height) of the characters.
italic - If true the text will be drawn italic, normal otherwise.
bold - If true the text will be drawn bold, normal otherwise.
hspacing - The horizontal spece bteween characters.

loadFont

protected void loadFont(java.net.URL url)
                 throws java.io.IOException
Loads the the font data from the given URL.
Parameters:
url - The URL of the font definition file ( a *.gjf file)