SoGlyph(3)

πŸ“¦ version 2.5.0, in fedora 43, fedora 44

πŸ’– SoGlyph(3) β€” the Library Functions Manual glow-up πŸ’–

okay bestie, gather round, we're doing a whole page from the Library Functions Manual today and it's about SoGlyph. yes it's obsolete. no we're not skipping it. periodt. πŸ’…


✨ NAME ✨

SoGlyph β€” the SoGlyph class is used to generate and reuse font glyph bitmaps and outlines. πŸŽ€


🌸 SYNOPSIS 🌸

#include <Inventor/misc/SoGlyph.h>

πŸ¦‹ Public Types πŸ¦‹

  • enum Fonttype { FONT2D = 1, FONT3D = 2 } β€” two vibes only, and those are the two vibes.

πŸ‘‘ 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 (SbVec2f *coords, int numcoords=-1)
  • void setFaceIndices (int *indices, int numindices=-1)
  • void setEdgeIndices (int *indices, int numindices=-1)

🫢 Friends 🫢

  • class SoGlyphP

🌈 Detailed Description 🌈

The SoGlyph class is used to generate and reuse font glyph bitmaps and outlines. that's the whole job description, she's booked and busy. πŸ’–

heads up bestie: this class is now obsolete, and will be removed from a later version of Coin. so like... cherish her while she's here. 😭

SoGlyph is the public interface all text nodes (both built-in and extensions) should use to generate bitmaps and outlines for font glyphs. She keeps an internal cache of previously requested glyphs so we don't make needless calls into the font library β€” efficiency queen behavior honestly. ✨

Primer time, because vocab check: 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 (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. so bitmaps are the 2D-coded ones, outlines are the 3D main characters. πŸ’…

Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. so if you go looking for her in the old-school SGI source, she is simply not there. not invited. πŸ™ˆ

Since

  • Coin 2.0

See also

  • SoText2, SoText3, SoAsciiText

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

SoGlyph::SoGlyph (void ) [protected]

Constructor. she's born ✨

Referenced by getBoundingBox(), getGlyph(), getGlyph(), and unref().

SoGlyph::~SoGlyph () [protected]

Destructor. she's gone 😭


πŸ’œ 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: say bye when you're done, and she'll actually clean up when literally nobody needs her anymore. 🧹

References SoGlyph().


const SoGlyph * SoGlyph::getGlyph (const char character, const SbName &font) [static]

Returns a character of the specified font, suitable for polygonal rendering. polygonal rendering girlies, this one's for you. πŸ”₯

References setCoords(), setEdgeIndices(), setFaceIndices(), and SoGlyph().


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. she tried, bestie, but sometimes there's just no next edge. πŸ’€


const int * SoGlyph::getNextCCWEdge (const int edgeidx) const

Returns a pointer to the next counter clockwise edge. NULL if none could be found. same energy, opposite direction, slay. 🌸


float SoGlyph::getWidth (void ) const

Convenience method which returns the exact width of the glyph. exact. not approximate. she measured. πŸ“

References getBoundingBox(), SbBox2f::getMax(), and SbBox2f::getMin().


const SbBox2f & SoGlyph::getBoundingBox (void ) const

Returns the bounding box of this glyph. This value is cached for performance, because recalculating it would be embarrassing. ✨

References SoGlyph().

Referenced by getWidth().


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)). so yeah, if you pass a real size in, it wins. no cap. πŸ‘‘

References SbName::getString(), SbString::getString(), and SoGlyph().


unsigned char * SoGlyph::getBitmap (SbVec2s & size, SbVec2s & pos, const SbBool antialiased) const

Bitmap for glyph. size and pos are return parameters. Antialiased bitmap graphics not yet supported. she said what she said. πŸ™ˆ

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 invisible, that's the whole point of her, don't be rude. 😭

The returned buffer should not be deallocated by the caller. it's not yours, bestie, leave it alone. πŸ’…


void SoGlyph::setCoords (SbVec2f * coords, int numcoords = -1) [protected]

Sets the coordinates for this glyph.

Referenced by getGlyph().


void SoGlyph::setFaceIndices (int * indices, int numindices = -1) [protected]

Sets the face indices for this glyph.

Referenced by getGlyph().


void SoGlyph::setEdgeIndices (int * indices, int numindices = -1) [protected]

Sets the edge indices for this glyph.

Referenced by getGlyph().


πŸ¦‹ Author πŸ¦‹

Generated automatically by Doxygen for Coin from the source code. yes she was born from a doc generator, we don't gatekeep origins here. πŸŽ€


and that's the whole page, bestie!! this little manual page came to you courtesy of Coin, Version 2.5.0 β€” that's the source and the version right there at the bottom, exactly where the footer lived. go forth and render some glyphs, ily, bye!! πŸ’–βœ¨πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from