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:

    <TABLE border=0 cellspacing=0 cellpadding=5>
       <TR><TD valign=_top> SERIF        <TD valign=_top> Times New Roman
       <TR><TD valign=_top> SANS         <TD valign=_top> Arial
       <TR><TD valign=_top> TYPEWRITER   <TD valign=_top> Courier New
    </TABLE> 
    

    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.