SOFONTSTYLE(3iv)

πŸ’– SoFontStyle(3IV) β€” bestie's guide to the simple 3D text shape node πŸ’–

okay so real quick before we dive in: this whole page lives in the SoFontStyle(3IV) manual, and it's literally about one little node that's a simple 3D text shape node. that's the whole vibe. let's go πŸ¦‹


✨ INHERITS FROM ✨

it's giving ancestry dot com, bestie:

SoBase > SoFieldContainer > SoNode > SoFont > SoFontStyle

so yeah, she comes from a long line of icons. πŸ‘‘


🌸 SYNOPSIS 🌸

first things first, you gotta pull her in:

#include <Inventor/nodes/SoFontStyle.h>

the Family enum (pick your font's whole personality)

enum Family {
     SoFontStyle::SERIF       Use Serif style (such as Times-Roman)
     SoFontStyle::SANS        Use Sans Serif style (such as Helvetica)
     SoFontStyle::TYPEWRITER  Use fixed pitch style (such as Courier)
}

the Style enum (the glow-up modifiers)

enum Style {
     SoFontStyle::NONE    No modification to Family
     SoFontStyle::BOLD    Embolden Family
     SoFontStyle::ITALIC  Italicize or Slant Family
}

Fields she brings from class SoFontStyle

SoSFEnum            family
SoSFBitMask         style

Fields she inherited from class SoFont (thanks mom)

SoSFName            name
SoSFFloat           size

Methods from class SoFontStyle

                    SoFontStyle()
static SoType       getClassTypeId()
SbString            getFontName()

Methods from class SoNode

void                setOverride(SbBool state)
SbBool              isOverride() const
SoNode *            copy(SbBool copyConnections = FALSE) const
virtual SbBool      affectsState() const
static SoNode *     getByName(const SbName &name)
static int          getByName(const SbName &name, SoNodeList &list)

Methods from class SoFieldContainer

void                setToDefaults()
SbBool              hasDefaultValues() const
SbBool              fieldsAreEqual(const SoFieldContainer *fc) const
void                copyFieldValues(const SoFieldContainer *fc, SbBool
                         copyConnections = FALSE)
SbBool              set(const char *fieldDataString)
void                get(SbString &fieldDataString)
virtual int         getFields(SoFieldList &resultList) const
virtual SoField *   getField(const SbName &fieldName) const
SbBool              getFieldName(const SoField *field, SbName &fieldName)
                         const
SbBool              isNotifyEnabled() const
SbBool              enableNotify(SbBool flag)

Methods from class SoBase

void                ref()
void                unref() const
void                unrefNoDelete() const
void                touch()
virtual SoType      getTypeId() const
SbBool              isOfType(SoType type) const
virtual void        setName(const SbName &name)
virtual SbName      getName() const

πŸ’… DESCRIPTION πŸ’…

okay so here's the tea: this node sets the current font family and style for all the text shapes that come after it in the scene graph. like, she walks into the room and every text node behind her is like "yes ma'am, we're wearing Serif now." it's giving trendsetter energy, no cap. πŸŽ€


🌈 FIELDS 🌈

  • SoSFEnum family β€” defines the family of font to use. this is the which font dynasty are we in field, bestie.
  • SoSFBitMask style β€” defines style modifications to the chosen font, either bold or italic or no change. she's a bitmask so she can stack those vibes. ✨

🫢 METHODS 🫢

  • SoFontStyle() β€” creates a font style node with default settings. a fresh baby node, brand new, defaults intact, so cute.
  • static SoType getClassTypeId() β€” returns type identifier for this class. her little ID card, iykyk.
  • SbString getFontName() β€” returns the font name used by this node based on the settings of family and style. she tells you what she's actually wearing after all that mixing and matching. πŸ’–

πŸ”₯ ACTION BEHAVIOR πŸ”₯

SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoRayPickAction

sets the font family and style in the current traversal state. every one of those actions rolls through and the state gets updated, periodt.


🧚 FILE FORMAT / DEFAULTS 🧚

here's exactly what she looks like straight out of the box:

FontStyle {
     name    "defaultFont"
     size    10
     family  SERIF
     style   NONE
}

so: name is "defaultFont", size is 10, family is SERIF, and style is NONE. no notes, flawless. πŸ‘‘


⭐ SEE ALSO ⭐

SoAsciiText, SoFont, SoText2, SoText3

go read those too bestie, they're all in the same friend group. 🌸


and that's the whole page!! this was SoFontStyle(3IV), from the SoFontStyle(3IV) manual β€” the date on this one is literally blank, which is such a mystery era of her, honestly iconic. mwah, love u, go make some 3D text. πŸ’–πŸ¦‹βœ¨