All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.media.j3d.Font3D

java.lang.Object
   |
   +----java.media.j3d.Font3D

public class Font3D
extends Object
The Font3D object is used to store extruded 2D glyphs. These 3D glyphs can then be used to contruct Text3D NodeComponent objects. Custom 3D fonts as well as methods to store 3D fonts to disk will be addressed in a future release.

A 3D Font consists of a Java 2D font and an extrusion path. The extrusion path describes how the edge of a glyph varies in the Z axis.

See Also:
Font, FontExtrusion, Text3D

Constructor Index

 o Font3D(Font, FontExtrusion)
Creates a Font3D object from the specified Font object.

Method Index

 o getAsLines(int, LineStripArray)
Returns a LineStripArray representing the 3D glyph.
 o getAsTriangles(int, GeometryStripArray[])
Returns an array of GeometryStripArray's representing the 3D glyph.
 o getBounds(int, Bounds)
Returns the 3D bounding box of the specified glyph code.
 o getFont()
Returns the Java 2D Font used to create this Font3D object.
 o getFontExtrusion(FontExtrusion)
Copies the FontExtrusion object used to create this Font3D object into the specified parameter.

Constructors

 o Font3D
 public Font3D(Font font,
               FontExtrusion extrudePath)
Creates a Font3D object from the specified Font object. The FontExtrusion object contains the extrusion path to use on the 2D Font glyphs. To ensure correct rendering the font must be created with the default AffineTransform. The point size of a Font object is used as a rough measure of how finely to tesselate the glyphs. A larger point size will, in general, have finer detail than the same font with a smaller point size. Passing null for the FontExtrusion parameter results in no extrusion being done.

Parameters:
font - the Java 2D font used to create the 3D font object.
extrudePath - the extrusion path used to describe how the edge of the font varies along the Z axis.
See Also:
Font, FontExtrusion

Methods

 o getFont
 public Font getFont()
Returns the Java 2D Font used to create this Font3D object.

 o getFontExtrusion
 public void getFontExtrusion(FontExtrusion extrudePath)
Copies the FontExtrusion object used to create this Font3D object into the specified parameter.

See Also:
FontExtrusion
 o getBounds
 public int getBounds(int glyphCode,
                      Bounds bounds)
Returns the 3D bounding box of the specified glyph code.

Parameters:
glyphCode - the glyphCode from the original 2D Font.
bounds - will hold the bounds of the 3D glyph.
See Also:
Bounds
 o getAsTriangles
 public void getAsTriangles(int glyphCode,
                            GeometryStripArray geometry[])
Returns an array of GeometryStripArray's representing the 3D glyph. The amount of tesselation is roughly determined by the point size used to create the 2D Font object. A larger point size will, in general, have finer detail than the same font with a smaller point size.

A 3D glyph is always defined in a normalized space where the base of the glyph is 0.0 on the y-axis and the left side of the glyph is at 0.0 on the x-axis. Because of descenders the glyph's coordinates can be negative. The maximum value of this space is the maximum glyph width & height (obtained from FontDesignMetrics::getBounds()).

See Also:
Font, FontExtrusion
 o getAsLines
 public void getAsLines(int glyphCode,
                        LineStripArray geometry)
Returns a LineStripArray representing the 3D glyph. The amount of tesselation is roughly determined by the point size used to create the 2D Font object. A larger point size will, in general, have finer detail than the same font with a smaller point size.

A 3D glyph is always defined in a normalized space where the base of the glyph is 0.0 on the y-axis and the left side of the glyph is at 0.0 on the x-axis. Because of descenders the glyph's coordinates can be negative. The maximum value of this space is the maximum glyph width & height (obtained from FontDesignMetrics::getBounds()).

See Also:
Font, FontExtrusion

All Packages  Class Hierarchy  This Package  Previous  Next  Index