Class SoFontStyle

  • All Implemented Interfaces:

    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:
    SoAsciiText, SoFont, SoText2, SoText3
    • Field Detail

      • 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.
    • Constructor Detail

      • SoFontStyle

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

      • getFontName

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