SoGlyph(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

✨ 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, FONT2D and FONT3D, and the numbers are exactly 1 and 2 no cap

πŸŽ€ Public Member Functions

  • void unref (void) const
  • const SbVec2f * getCoords (void) const
  • const int * getFaceIndices (void) const
  • const int * getEdgeIndices (void) const
  • const int * getNextCWEdge (const int edgeidx) const
  • const int * getNextCCWEdge (const int edgeidx) const
  • float getWidth (void) const
  • const SbBox2f & getBoundingBox (void) const
  • SbVec2s getAdvance (void) const
  • SbVec2s getKerning (const SoGlyph &rightglyph) const
  • unsigned 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