SOFONT(3iv)

πŸ‘‘ SoFont β€” NAME πŸ‘‘

SoFont β€” the node that defines the font type and size for text, and honestly? it's giving main character energy for every text shape that comes after it. πŸ’…


🧬 INHERITS FROM 🧬

SoBase > SoFieldContainer > SoNode > SoFont

like yes, she comes from a whole lineage of icons. generational wealth of nodes fr fr πŸ’–


✨ SYNOPSIS ✨

#include <Inventor/nodes/SoFont.h>
   Fields from class SoFont:

SoSFName            name
SoSFFloat           size

   Methods from class SoFont:

                      SoFont()
static SoType       getClassTypeId()

   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

look at all those inherited methods, she's literally carrying her whole family tree on her back and doing it flawlessly 🫢


🌸 DESCRIPTION 🌸

okay so listen. πŸ’– This node sets the current font type and point size for all subsequent text shapes in the scene graph. Like, once you drop a SoFont, everything downstream is reading from her notes. periodt.

Fonts are specified with PostScript names β€” with one iconic exception: the default font. The default font is called "defaultFont" and is the standard SGI graphics font for 2D text. And "Utopia"? That's the standard Inventor font for 3D text. iykyk πŸ¦‹


πŸŽ€ FIELDS πŸŽ€

  • SoSFName name β€” this field is the font name, as a PostScript name. So like, Times Roman? You'd write it as Times-Roman. πŸ’… And get this β€” you can specify multiple fonts by separating the font names with semicolons. When you do that, the first font in the list that contains a given character is the one used to render that character. iconic fallback behaviour, no cap. ✨
  • SoSFFloat size β€” this field is the font size. The value is in points for 2D text, and in the current units for 3D text. yes bestie, the units literally change depending on the dimensionality. that's just how she is. 🌈

πŸ¦‹ METHODS πŸ¦‹

  • SoFont() β€” creates a font node with default settings. fresh out the box, ready to serve. πŸ‘‘
  • static SoType getClassTypeId() β€” returns the type identifier for this class. it's her ID, her passport, her birth certificate. πŸŽ€

πŸ”₯ ACTION BEHAVIOR πŸ”₯

SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoRayPickAction

Sets the font name and size in the current traversal state. that's it, that's the whole job, and she does it every single time without complaint. a professional. πŸ’…βœ¨


πŸ’€ FILE FORMAT/DEFAULTS πŸ’€

Font {
   name  "defaultFont"
   size  10
}

defaults are "defaultFont" and 10, and honestly? she ate. πŸ“


🌈 SEE ALSO 🌈

  • SoText2
  • SoText3

go read those too bestie, they're the ones actually using all this font info. 🫢


okay that's the whole page!! this was SoFont(3IV) β€” the footer just says SoFont(3IV)() with the date slot left all empty, so no date tea to spill, we're running on vibes only. πŸ’–βœ¨πŸŽ€ stay slaying, and remember: set your font before your text, or your text is getting the default whether it likes it or not. 😭πŸ’