|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.graphics.typography.GlyphSet
public class GlyphSet
Stores a set of Glyph objects.
Constructor Summary | |
---|---|
GlyphSet(String filename,
String fontname,
String typeface,
int fontSize,
int bytesPerPixel,
int format,
int dataType)
Constructs a GlyphSet. |
Method Summary | |
---|---|
void |
addGlyph(Glyph glyph)
Adds a Glyph object to this GlyphSet. |
int |
getBytesPerPixel()
Returns the number of bytes per pixel. |
int |
getDataType()
Returns the OpenGL data type (such as GL.GL_UNSIGNED_BYTE). |
String |
getFilename()
Returns the name of the file the glyphs were read from. |
String |
getFontname()
Returns the name of the font this set of glyphs belongs to. |
int |
getFontSize()
Returns the font size. |
int |
getFormat()
Returns the OpenGL format (such as GL.GL_LUMINANCE_ALPHA). |
Glyph |
getGlyph(String name)
Returns the Glyph object for the name given as an argument (or null if it cannot be found). |
List<Glyph> |
getGlyphs(String text)
Returns a list of Glyph objects corresponding to the characters of the String given as an argument. |
String |
getTypeface()
Returns the typeface for the glyphs (bold, italic, regular, etc.). |
String |
getUnknownChars()
Returns a String composed of any characters that were missing (no corresponding Glyph) when the last call to getGlyphs(text) was made. |
boolean |
hadUnknownChars()
Returns true if the last call to getGlyphs(text) had any unknown characters in the String (unknown in the sense that the GlyphSet did not have a Glyph for a character). |
Iterator<Glyph> |
iteratorGlyphs()
Returns an Iterator for the Glyphs. |
int |
numberOfGlyphs()
Returns the number of Glyphs in the set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GlyphSet(String filename, String fontname, String typeface, int fontSize, int bytesPerPixel, int format, int dataType)
filename
- the name of the file the glyph set was read from.fontname
- the name of the font the glyphs belong to.typeface
- a type such as bold, italic, or regular.fontSize
- the size of the font in points.bytesPerPixel
- there can be 1 to 4 bytes per pixel.format
- the OpenGL format (such as GL.GL_LUMINANCE_ALPHA).dataType
- the OpenGL data type (such as
GL.GL_UNSIGNED_BYTES).Method Detail |
---|
public void addGlyph(Glyph glyph)
glyph
- the Glyph to add.public Glyph getGlyph(String name)
name
- the name of a glyph is usually a single character.public List<Glyph> getGlyphs(String text)
text
- the name of a glyph is usually a single character.public String getUnknownChars()
public boolean hadUnknownChars()
public String getFilename()
public String getFontname()
public String getTypeface()
public int getFontSize()
public int getBytesPerPixel()
public int getFormat()
public int getDataType()
public Iterator<Glyph> iteratorGlyphs()
public int numberOfGlyphs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |