SoGlyph(3)
β¨ SoGlyph β¨
okay bestie, welcome to SoGlyph(3) from the Coin manual π this one's a little vintage, so buckle up π
πΈ NAME πΈ
SoGlyph β the SoGlyph class is used to generate and reuse font glyph bitmaps and outlines. yes literally that's its whole job, and it does it iconically π
π¦ SYNOPSIS π¦
#include <Inventor/misc/SoGlyph.h>
π Public Types
enum Fonttype { FONT2D = 1, FONT3D = 2 }β two vibes of font type,FONT2DandFONT3D, and the numbers are exactly1and2no cap
π Public Member Functions
void unref (void) constconst SbVec2f * getCoords (void) constconst int * getFaceIndices (void) constconst int * getEdgeIndices (void) constconst int * getNextCWEdge (const int edgeidx) constconst int * getNextCCWEdge (const int edgeidx) constfloat getWidth (void) constconst SbBox2f & getBoundingBox (void) constSbVec2s getAdvance (void) constSbVec2s getKerning (const SoGlyph &rightglyph) constunsigned char * getBitmap (SbVec2s &size, SbVec2s &pos, const SbBool antialiased) const
π Static Public Member Functions
static const SoGlyph * getGlyph (const char character, const SbName &font)static const SoGlyph * getGlyph (SoState *state, const unsigned int character, const SbVec2s &size, const float angle)
π«Ά Protected Member Functions
SoGlyph (void)~SoGlyph ()void setCoords (const SbVec2f *coords, int numcoords=-1)void setFaceIndices (const int *indices, int numindices=-1)void setEdgeIndices (const int *indices, int numindices=-1)
π Detailed Description π
The SoGlyph class is used to generate and reuse font glyph bitmaps and outlines. (yes, same sentence as the NAME section, it's giving consistency π
)
π heads up bestie: this class is now obsolete, and it will be removed from a later version of Coin. it's not doing anything wrong, it's just time.
SoGlyph is the public interface all text nodes β both the built-in ones and any extensions β should use to generate bitmaps and outlines for font glyphs. It keeps an internal cache of previously requested glyphs so we don't make needless calls into the font library. cache = self care, fr fr π
Primer moment, because you deserve the lore π§: a glyph is the graphical representation of a given character of a given font at a given size and orientation. It can be either:
- a bitmap (pixel aligned with the viewport), or
- an outline (a polygonal representation) that can be transformed or extruded like any other 3D geometry.
Bitmaps are used by SoText2, while the other text nodes use outlines. two paths, both slay β¨
Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. (coin-only behavior, iykyk)
Since
Coin 2.0 π
See also
SoText2, SoText3, SoAsciiText
π Constructor & Destructor Documentation π
SoGlyph::SoGlyph (void ) [protected]
Constructor. πΌ that's it, that's the whole description.
SoGlyph::~SoGlyph () [protected]
Destructor. πͺ¦ bye bb
π Member Function Documentation π
void SoGlyph::unref (void ) const
Should be called when a node no longer will use a glyph. Will free memory used by this glyph when it is no longer used by any node. basically the polite way to say "we're done here" π«Ά
const SoGlyph * SoGlyph::getGlyph (const char character, const SbName & font) [static]
Returns a character of the specified font, suitable for polygonal rendering. πΊβ¨
const SbVec2f * SoGlyph::getCoords (void ) const
Returns coordinates for this glyph. π
const int * SoGlyph::getFaceIndices (void ) const
Returns face indices for this glyph. π
const int * SoGlyph::getEdgeIndices (void ) const
Returns edge indices for this glyph. π
const int * SoGlyph::getNextCWEdge (const int edgeidx) const
Returns a pointer to the next clockwise edge. Returns NULL if none could be found. (NULL is a real outcome here, don't be shocked) β°
const int * SoGlyph::getNextCCWEdge (const int edgeidx) const
Returns a pointer to the next counterclockwise edge. Returns NULL if none could be found. βͺ
float SoGlyph::getWidth (void ) const
Convenience method which returns the exact width of the glyph. exact. not approximate. exact. π
const SbBox2f & SoGlyph::getBoundingBox (void ) const
Returns the bounding box of this glyph. This value is cached for performance. β‘ (the cache is the whole point, bestie)
const SoGlyph * SoGlyph::getGlyph (SoState * state, const unsigned int character, const SbVec2s & size, const float angle) [static]
Returns a character of the specified font, suitable for bitmap rendering. The size parameter overrides state's SoFontSizeElement (if != SbVec2s(0,0)). πΌοΈ careful with that override, it's got main character energy
unsigned char * SoGlyph::getBitmap (SbVec2s & size, SbVec2s & pos, const SbBool antialiased) const
Bitmap for glyph. size and pos are return parameters. Antialiased bitmap graphics are not yet supported. π
β οΈ Note that this function may return NULL if the glyph has no visible pixels (as for e.g. the space character). yes, the space character is out here being invisible and unbothered π
π‘ The returned buffer should not be deallocated by the caller. that memory is not yours to free, hands off π«Ά
void SoGlyph::setCoords (const SbVec2f * coords, int numcoords = -1) [protected]
Sets the coordinates for this glyph. π οΈ
void SoGlyph::setFaceIndices (const int * indices, int numindices = -1) [protected]
Sets the face indices for this glyph. π οΈ
void SoGlyph::setEdgeIndices (const int * indices, int numindices = -1) [protected]
Sets the edge indices for this glyph. π οΈ
π Author π
Generated automatically by Doxygen for Coin from the source code. the robots wrote this one and honestly? they ate π€π
and that's the whole page bestie!! π go forth and glyph responsibly πβ¨
Version 4.0.10 β Thu Jun 25 2026 00:00:00 β SoGlyph(3) ππ¦
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms