Defines font family and style for text. More...
#include <Inventor/nodes/SoFontStyle.h>
Public Types | |
enum | Family { SERIF , SANS , TYPEWRITER } |
Font style family. More... | |
enum | Style { NONE = 0 , BOLD = 0x1 , ITALIC = 0x2 } |
Public Types inherited from SoFont | |
enum | RenderStyle { POLYGON , TEXTURE , TEXTURE_DELAYED , POLYGON_AND_OUTLINE } |
Render style. More... | |
Public Member Functions | |
virtual SoType | getTypeId () const |
Returns the type identifier for this specific instance. | |
SoFontStyle () | |
Creates a font style node with default settings. | |
SbString | getFontName () |
Returns the font name used by this node based on the settings of family and style. | |
Public Member Functions inherited from SoFont | |
SoFont () | |
Creates a font node with default settings. | |
virtual void | setOverride (const SbBool state) |
Set the state of the override field. | |
virtual SbBool | isOverride () const |
Returns the state of the override field. | |
Public Member Functions inherited from SoNode | |
virtual SoNode * | copy (SbBool copyConnections=FALSE) const |
Creates and returns an exact copy of the node. | |
virtual SbBool | affectsState () const |
Returns TRUE if a node has an effect on the state during traversal. | |
virtual void | touch () |
Marks an instance as modified, simulating a change to it. | |
Public Member Functions inherited from SoFieldContainer | |
void | setToDefaults () |
Sets all fields in this object to their default values. | |
SbBool | hasDefaultValues () const |
Returns TRUE if all of the object's fields have their default values. | |
SbBool | fieldsAreEqual (const SoFieldContainer *fc) const |
Returns TRUE if this object's fields are exactly equal to fc's fields. | |
void | copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE) |
Copies the contents of fc's fields into this object's fields. | |
SoNONUNICODE SbBool | set (const char *fieldDataString) |
Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format. | |
SbBool | set (const SbString &fieldDataString) |
Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format. | |
void | get (SbString &fieldDataString) |
Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string. | |
virtual int | getFields (SoFieldList &list) const |
Appends references to all of this object's fields to resultList, and returns the number of fields appended. | |
virtual int | getAllFields (SoFieldList &list) const |
Returns a list of fields, including the eventIn's and eventOut's. | |
virtual SoField * | getField (const SbName &fieldName) const |
Returns a the field of this object whose name is fieldName. | |
virtual SoField * | getEventIn (const SbName &fieldName) const |
Returns a the eventIn with the given name. | |
virtual SoField * | getEventOut (const SbName &fieldName) const |
Returns the eventOut with the given name. | |
SbBool | getFieldName (const SoField *field, SbName &fieldName) const |
Returns the name of the given field in the fieldName argument. | |
SbBool | enableNotify (SbBool flag) |
Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE). | |
SbBool | isNotifyEnabled () const |
Notification is the process of telling interested objects that this object has changed. | |
virtual void | setUserData (void *data) |
Sets application data. | |
void * | getUserData (void) const |
Gets user application data. | |
Public Member Functions inherited from SoBase | |
virtual SbName | getName () const |
Returns the name of an instance. | |
virtual void | setName (const SbName &name) |
Sets the name of an instance. | |
void | setSynchronizable (const bool b) |
Sets this to be a ScaleViz synchronizable object. | |
bool | isSynchronizable () const |
Gets the ScaleViz synchronizable state of this object. | |
Public Member Functions inherited from SoRefCounter | |
void | ref () const |
Adds a reference to an instance. | |
void | unref () const |
Removes a reference from an instance. | |
void | unrefNoDelete () const |
unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero. | |
int | getRefCount () const |
Returns current reference count. | |
void | lock () const |
lock this instance. | |
void | unlock () const |
unlock this instance. | |
Public Member Functions inherited from SoTypedObject | |
SbBool | isOfType (const SoType &type) const |
Returns TRUE if this object is of the type specified in type or is derived from that type. | |
template<typename TypedObjectClass > | |
SbBool | isOfType () const |
Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class. | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Static Public Member Functions inherited from SoFont | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
static void | enableJapaneseSF (SbBool flag=TRUE) |
Sets flag to enable strings to be interpreted using the Japanese MBCS encoding. | |
static SbBool | isJapaneseSFEnabled () |
Gets flag that indicates whether strings should be interpreted using the MCS Japanese MBCS encoding. | |
static void | setNumFontCaches (int maxNumCaches) |
Sets the maximum number of caches that can be used for font rendering. | |
static int | getNumFontCaches () |
Returns the maximum number of caches that can be used for font rendering. | |
static int | getCurrNumFontCaches () |
Returns the current number of caches used for font rendering. | |
static int | getAvailableFonts (SbString *&strings, SbBool clearDB=FALSE) |
Returns the number of loadable font files and a list of their names. | |
static SoNONUNICODE void | setFontPaths (char *) |
Specifies paths for searching for font files. | |
static void | setFontPaths (const SbString &) |
Specifies paths for searching for font files. | |
static SoNONUNICODE void | addFontPaths (char *) |
Specifies paths for searching for font files. | |
static void | addFontPaths (const SbString &) |
Specifies paths for searching for font files. | |
static SbString | getFontPaths () |
Gets current font path list. | |
static SoNONUNICODE SbBool | isAvailableFont (char *) |
Returns TRUE if the specified font is available for use by Open Inventor. | |
static SbBool | isAvailableFont (const SbString &) |
Returns TRUE if the specified font is available for use by Open Inventor. | |
static void | clearFontNameCache () |
Clears the Open Inventor internal font name cache, i.e., the list of available fonts. | |
Static Public Member Functions inherited from SoNode | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
static SoNode * | getByName (const SbName &name) |
A node's name can be set using SoBase::setName(). | |
static int | getByName (const SbName &name, SoNodeList &list) |
A node's name can be set using SoBase::setName(). | |
Static Public Member Functions inherited from SoFieldContainer | |
static SoType | getClassTypeId () |
Returns the type of this class. | |
Static Public Member Functions inherited from SoBase | |
static SoType | getClassTypeId () |
Returns type identifier for this class. | |
Static Public Member Functions inherited from SoTypedObject | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Public Attributes | |
SoSFEnum | family |
Specifies the family of font to use (which determines the font name according to table above). | |
SoSFBitMask | style |
Specifies style of the chosen font. | |
Public Attributes inherited from SoFont | |
SoSFString | name |
This field specifies the font name. | |
SoSFFloat | size |
This field specifies the font size. | |
SoSFEnum | renderStyle |
This field specifies the rendering style of the font. | |
Defines font family and style for text.
This node defines the current font family and style for all subsequent text shapes in the scene graph.
Note: The "name" field inherited from SoFont is ignored by SoFontStyle. This node maps font family and style to a specific predefined font, according to the OS in use. Use the getFontName() method to get the actual font name that will be used.
On Windows, the font families are mapped as follows:
SERIF | Times New Roman |
SANS | Arial |
TYPEWRITER | Courier New |
name | "defaultFont" |
size | 10 |
family | SERIF |
style | NONE |
renderStyle | POLYGON |
SoAsciiText, SoFont, SoText2, SoText3
Definition at line 110 of file SoFontStyle.h.
enum SoFontStyle::Family |
Font style family.
Enumerator | |
---|---|
SERIF | Use Serif style (such as Times-Roman) |
SANS | Use Sans Serif style (such as Helvetica) |
TYPEWRITER | Use fixed pitch style (such as Courier) |
Definition at line 121 of file SoFontStyle.h.
enum SoFontStyle::Style |
Enumerator | |
---|---|
NONE | No modification to Family. |
BOLD | Embolden Family. |
ITALIC | Italicize or slant Family. |
Definition at line 136 of file SoFontStyle.h.
SoFontStyle::SoFontStyle | ( | ) |
Creates a font style node with default settings.
|
static |
Returns the type identifier for this class.
SbString SoFontStyle::getFontName | ( | ) |
Returns the font name used by this node based on the settings of family and style.
|
virtual |
Returns the type identifier for this specific instance.
Reimplemented from SoFont.
SoSFEnum SoFontStyle::family |
Specifies the family of font to use (which determines the font name according to table above).
Use enum Family. Default is SERIF.
Definition at line 156 of file SoFontStyle.h.
SoSFBitMask SoFontStyle::style |
Specifies style of the chosen font.
Use enum Style. Default is NONE.
Definition at line 161 of file SoFontStyle.h.