SoGlyph(3)

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

πŸ’– SoGlyph πŸ’–

okay bestie, so this is the SoGlyph page from the Coin library functions manual, and honestly? she's a vintage icon. come sit with me 🫢


🌸 NAME 🌸

SoGlyph β€” the class that generates and reuses font glyph bitmaps and outlines. no cap, that's literally her whole job.


✨ SYNOPSIS ✨

#include <Inventor/misc/SoGlyph.h>

πŸŽ€ Public Types πŸŽ€

enum Fonttype { FONT2D = 1, FONT3D = 2 }

like, two flavours of font energy. FONT2D is 1, FONT3D is 2, and that's the whole menu πŸ’…

πŸ¦‹ 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. πŸ’–

⚠️ bestie, real talk: this class is now obsolete, and will be removed from a later version of Coin. she's giving retirement party, not comeback tour 😭

SoGlyph is the public interface all text nodes (both built-in and extensions) should use to generate bitmaps and outlines for font glyphs. it maintains an internal cache of previously requested glyphs to avoid needless calls into the font library. efficiency queen behavior. πŸ‘‘

Primer, because vocabulary matters: 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 uses outlines. so like, two totally different aesthetics, same glyph ✨

Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. exclusive to Coin, iykyk πŸ’…

Since

Coin 2.0 πŸŽ‚

See also

SoText2, SoText3, SoAsciiText β€” the trio, go say hi 🫢


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

SoGlyph::SoGlyph (void ) [protected]

Constructor. 🐣

SoGlyph::~SoGlyph () [protected]

Destructor. πŸ’€


🌟 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. cleanup era, we love to see it 🧹

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. πŸ”„

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

Returns a pointer to the next counter clockwise edge. NULL if none could be found. πŸ”

float SoGlyph::getWidth (void ) const

Convenience method which returns the exact width of the glyph. πŸ“

const SbBox2f & SoGlyph::getBoundingBox (void ) const

Returns the bounding box of this glyph. This value is cached for performance. cached?? we love a girl who remembers things 🧠✨

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)) πŸ–ΌοΈ

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. 🫠

heads up bestie: 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 on purpose 😭

The returned buffer should not be deallocated by the caller. do not free it, I am so serious πŸ™ˆ

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. she didn't write herself, she was born that way ✨


okay that's the whole page, no skips, no summaries, every single signature intact πŸ’… and for the cute sign-off: this diva comes to you from Coin, Version 3.1.3, dated with the classic SoGlyph(3) footer energy. mwah πŸŽ€πŸ’–

πŸ“¦ where this page comes from