SmallChange
1.0.0
A collection of extensions to Coin3D
|
Public Member Functions | |
FontImage (const SbVec2s glyphsize, const int leading, const int ascent, const int descent, const int numcomponents) | |
void | addGlyph (unsigned char c, const SbImage &image, const int width, const int gfxwidth=-1, const int xoffset=0) |
int | getAscent () const |
int | getDescent () const |
SoGLImage * | getGLImage (void) const |
SbImage | getGlyphImage (const unsigned char c) const |
SbVec2f | getGlyphPosition (unsigned char c) const |
SbVec2s | getGlyphPositionPixels (unsigned char c) const |
SbVec2f | getGlyphSize (unsigned char c) const |
const SbVec2s & | getGlyphSizePixels () const |
int | getGlyphWidth (unsigned char c) const |
int | getKerning (unsigned char glyph, unsigned char next) const |
int | getLeading () const |
int | getXOffset (unsigned char glyph) const |
int | height () const |
void | renderString (const SbString &s, const SbVec3f &pos, const bool needglbeginend=true) const |
void | setKerning (unsigned char glyph, unsigned char next, int kerning) |
int | stringWidth (const SbString &s) const |
void SmTextureFont::FontImage::addGlyph | ( | unsigned char | c, |
const SbImage & | image, | ||
const int | glyphwidth, | ||
const int | gfxglyphwidth = -1, | ||
const int | xoffset = 0 ) |
Adds the image for a glyph to the texture image. The size of the image must be smaller than the glyphsize provided in the constructor. glyphwidth is the number of pixels to advance before rendering the next character. gfxglyphwidth is the width of the glyph in the bitmap. If you supply a negative number in gfxglyphwidth, the width of the glyphs supplied in the constructor will be used instead.
xoffset is the offset used when rendering the glyph. This is useful for specifying glyphs that extend to the left of the glyph position.
Returns the SoGLImage instance for this font.
Returns the glyph image for c.
Returns the lower left corner position of the glyph in texture coordinates.
Returns the size of the glyph, in texture coordinates.
Returns the width of the glyph in the texture.
Returns the kerning for glyph/next. If no kerning info exists for the pair, the width of the glyph is returned.
Returns the x offset for glyph.
int SmTextureFont::FontImage::height | ( | ) | const |
Returns the height of the font (ascent + descent + 1).
void SmTextureFont::FontImage::renderString | ( | const SbString & | s, |
const SbVec3f & | pos, | ||
const bool | needglbeginend = true ) const |
Convenience method to render s at position pos. This function assumed a coordinate system with 1 pixel == 1 unit is set up.
Sets kerning for the glyph/next pair.
Convenience method that calculates the width (in pixels) for s.