Class SoFontStyle

All Implemented Interfaces:
SafeDisposable

public class SoFontStyle extends SoFont
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

File format/default:

FontStyle {

    name "defaultFont"
    size 10
    family SERIF
    style NONE
    renderStyle POLYGON
}

Action behavior:

SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoRayPickAction
Sets the font family and style in the current traversal state. Sets: SoFontNameElement, SoFontSizeElement,

See Also:
  • Field Details

    • family

      public final SoSFEnum<SoFontStyle.Families> family
      Specifies the family of font to use (which determines the font name according to table above). . Default is SERIF.
    • style

      public final SoSFBitMask<SoFontStyle.Styles> style
      Specifies style of the chosen font. . Default is NONE.
  • Constructor Details

    • SoFontStyle

      public SoFontStyle()
      Creates a font style node with default settings.
  • Method Details

    • getFontName

      public String getFontName()
      Returns the font name used by this node based on the settings of family and style.