Collaboration diagram for Bitmapped Fonts:
Functions | |
void | glutBitmapCharacter (GLUTfont font, int character) |
int | glutBitmapHeight (GLUTfont font) |
int | glutBitmapLength (GLUTfont font, const unsigned char *string) |
void | glutBitmapString (GLUTfont font, const unsigned char *string) |
int | glutBitmapWidth (GLUTfont font, int character) |
At this point in time, it would generally be preferred to use fonts laid out in textures. (But note that some systems may still benefit from the glBitmap() rendering.)
The biggest problem with the bitmapped fonts is that they always render in window coordinates, making them mostly of use for GUI elements or occasionally for "pinned" labels. The bitmapped fonts are of little interest to represent text on a surface or otherwise in a scene.
Of course, we are benefitting from a different perspective. Technology has changed, and OpenGLEAN's role is different than was GLUT's intended role.
The gleanfonts library currently supports only the standard GLUT fonts:
The fonts are:
GLUT_BITMAP_9_BY_15
gleanfonts Terminal (public domain) fixed-width bitmap fonts:
These fonts are fixed-width fonts that are generally suitable for terminal emulators. They are fixed-width (or monospace, if you prefer). They are well suited for extensive user interactive input, especially in multi-line input fields in contexts where alignment between lines may be relavent (e.g., in a programming text editor, or in an email context). Within the bounds of their resolution and fixed-width constraints, they are relatively pleasant to read.
gleanfonts Courier (Adobe) bitmap fonts:
The size value is in the set {8, 10, 12, 14, 18, 24}. "Italic" fonts are slanted, but do not have the usual cursive character of italics.
These are fixed-wdith Courier fonts from Adobe. In that they are fixed-width, they have some similarity to the previous set of fonts. However, they more closely resemble typewriter fonts, having wide serifs and spindly bodies. Especially at lower resolution, they are harder to read than the previous fixed width fonts, but in some contexts, especially if you use one of the larger varieties, can be attractive and useful.
GLUT_BITMAP_HELVETICA_18
gleanfonts Helvetica (Adobe) bitmap fonts:
The size value is in the set {8, 10, 12, 14, 18, 24}. "Italic" fonts are slanted, but do not have the usual cursive character of italics.
These proportionally spaced fonts are sans serif. As with the Courier fonts, Helvetica does not truly come in an italic variety; the "italic" format is merely slanted.
Sans serif fonts can be hard to read for large bodies of text, but can be clean and fairly tight. These fonts may be of interest for short labels in GUIs.
It is a known bug that the Helvetica glyphs seem to lose parts of their graphic images when extracted into gleanfonts. The cause of this is not known.
GLUT_BITMAP_TIMES_ROMAN_24
gleanfonts Times Roman (Adobe) bitmap fonts:
The size value is in the set {8, 10, 12, 14, 18, 24}.
These proportionately spaced fonts are serifed. They bear a resemblance to typefaces you may see in a newspaper. The font features true italics (not merely slanted) variation.
Because of their proportional spacing, they are inappropriate for many text-editing tasks, but if you are willing to (re)flow paragraphs with them, they tend to be fairly pleasant at the higher resolutions.
gleanfonts Symbol (Adobe) bitmap fonts:
The size value is in the set {8, 10, 12, 14, 18, 24}. No italic/slanted or bold forms are supported.
The symbol set provides numerous special symbols not provided in the normal ISO-8859-1 character set. Those Greek letters that do not correspond to Latin letters (especially an issue for lower case letters) are particular examples.
The symbol set is stylistically closest to Times Roman, but some parts have a more Helvetica feel. Aside from printing Greek messages, the symbol set is probably most useful for mathematics and formal logic.
Excepting the "terminal" fonts, these fonts are of limited interest in their lower resolutions, but if you wish to "zoom out" on text, the glyphs are still minimally legible even at a size of 8.
The fonts are extracted from an open-source X server, and generally cover ISO-8859-1, with printable values in the ranges 32--126 and 160--255. Additionally, the fixed-width fonts have non-standard glyphs in the range 1 through 31. The "symbol" font uses a special character set and follows no standard but its own.
The heights of the fonts are not generally encoded in their names, though the names give some indication of the heights. For example, the 8x13 fixed-width font is 14 pixels tall. The fixed width fonts have their widths embedded in their names: GLUT_BITMAP_8_BY_13 and GLUT_BITMAP_9_BY_15 .
|
Draw a bitmapped character.
Nothing is drawn, and the raster position is unaffected when either:
|
|
Return the height of a given bitmapped font, in pixels.
Returns 0 if font is invalid.
|
|
Return the width of a bitmapped string, in pixels.
As with glutBitmapString(), newlines are taken into consideration. Returns 0 if the font is invalid or if the string is empty or NULL.
|
|
Draw a string of bitmapped characters.
The starting raster position is used as the left margin for multi-line strings. Each newline character repositions the raster position at the beginning of the next line. Nothing is drawn, and the raster position is unaffected when either:
|
|
Return the width of a bitmapped character, in pixels.
It is also an upper bound on the width of the bitmapped glyph for character, though not all letters will use their full width, especially fixed-width fonts. Returns 0 if the character is out of the inclusive range [0,Quantity] or if the font is invalid. (Here, Quantity is the number of characters in the font.)
|
Supported in part by SourceForge.net.
Generated on Sun Sep 18 12:47:36 2005 for gleanfonts by
doxygen 1.4.3
The OpenGLEAN Fonts project is hosted by
SourceForge.