|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.graphics.typography.GLF2GlyphSetFactory
public class GLF2GlyphSetFactory
Reads a set of glyphs from a ".glf" file that was created with the
glFont program (Version 2.0) written by Brad Fish
(brad.fish@gmail.com).
The glFont program can be downloaded from
http://students.cs.byu.edu/~bfish/glfont.php (cited January 2007).
glFont is a Win32 program that creates a texture file containing a
user-specified range of characters in a Windows TrueType bitmap font
selected from a menu. Brad Fish also wrote a C++ class, glFont.cpp
(Copyright (c) 1998-2002 Brad Fish), that can be used to read in a
'.glf' file to create an OpenGL texture object and then map characters
from the texture onto OpenGL quads.
Because the ProteinShader program needs to map text onto curved
surfaces, a somewhat different approach needs to be taken. After
reading in a '.glf' file, the bitmap for each individual character
will be stored in a Glyph object as a 2D array of bytes. These
Glyph objects will be used by a TextLabelFactory to create TextLabel
objects that hold a 2D array of bytes with the characters for an
AminoAcid label (e.g., 'A 121' for alanine 121). To render the label
onto the surface of a segment of a tube or ribbon, a byte array will
be plugged in to the OpenGL glTexSubImage2D() function in order to
replace the center region of an existing OpenGL texture object. This
modified texture object can then be used to map the text label onto
any curved surface that has texture coordinates.
Field Summary | |
---|---|
static int |
BYTES_PER_PIXEL
The '.glf' image uses 2 bytes per pixel. |
static int |
DATA_TYPE
The '.glf' data type is GL.GL_UNSIGNED_BYTE. |
static int |
FORMAT
The '.glf' format is GL.GL_LUMINANCE_ALPHA. |
Constructor Summary | |
---|---|
GLF2GlyphSetFactory()
Constructs a GLF2GlyphSetFactory. |
Method Summary | |
---|---|
GlyphSet |
readGlyphSet(Properties p)
Reads information from a '.glf' file and constructs a GlyphSet object. |
void |
setDebug(boolean debug)
Setting debug to true will activate several print statements that are useful for troubleshooting. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BYTES_PER_PIXEL
public static final int FORMAT
public static final int DATA_TYPE
Constructor Detail |
---|
public GLF2GlyphSetFactory()
Method Detail |
---|
public void setDebug(boolean debug)
setDebug
in interface GlyphSetFactory
debug
- boolean value to turn debugging on or off.public GlyphSet readGlyphSet(Properties p) throws GlyphException
readGlyphSet
in interface GlyphSetFactory
p
- a Properties object is a type of hash.
GlyphException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |