SoTextProperty Class Reference
[Properties]

VSG extension Text property node. More...

#include <Inventor/nodes/SoTextProperty.h>

Inheritance diagram for SoTextProperty:
SoNode SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Public Types

enum  AlignmentH {
  LEFT = 0x01,
  CENTER = 0x03,
  RIGHT = 0x02
}
enum  AlignmentV {
  TOP = 0x01,
  HALF = 0x03,
  BASE = 0x04,
  BOTTOM = 0x05
}
enum  Orientation {
  LEFT_TO_RIGHT = 0x01,
  RIGHT_TO_LEFT = 0x02,
  TOP_TO_BOTTOM = 0x03,
  BOTTOM_TO_TOP = 0x04
}
enum  Style {
  NONE = SoTextStyleElement::NONE,
  UNDERLINE = SoTextStyleElement::UNDERLINE,
  STRIKETHROUGH = SoTextStyleElement::STRIKETHROUGH,
  DOUBLE_STRIKETHROUGH = SoTextStyleElement::DOUBLE_STRIKETHROUGH,
  BACK_FRAME = SoTextStyleElement::BACK_FRAME,
  BACK_FRAME_LINE = SoTextStyleElement::BACK_FRAME_LINE,
  OVERLINE = SoTextStyleElement::OVERLINE
}
enum  StyleColor {
  UNDERLINE_COLOR,
  STRIKETHROUGH_COLOR,
  DOUBLE_STRIKETHROUGH_COLOR,
  BACK_FRAME_COLOR,
  BACK_FRAME_LINE_COLOR,
  OVERLINE_COLOR,
  NUM_EFFECTS_COLORS
}

Public Member Functions

virtual SoType getTypeId () const
 SoTextProperty ()
virtual void setOverride (const SbBool state)
virtual SbBool isOverride () const

Static Public Member Functions

static SoType getClassTypeId ()

Public Attributes

SoSFFloat aliasingFactor
SoSFEnum alignmentH
SoSFEnum alignmentV
SoSFFloat backFrameLineWidth
SoSFBool kerning
SoSFEnum orientation
SoSFVec2i32 textureQualityRange
SoSFBitMask style
SoMFColorRGBA styleColors
SoSFFloat margin
SoMFBool styleColorsUseCurrentMaterial
SoSFFloat characterSpacing
SoSFBool enableTextAccumulation

Detailed Description

VSG extension Text property node.

This node specifies properties used for text rendering.

The application can specify text alignment and orientation using the alignmentH, alignmentV, and orientation fields.

Note:
Horizontal alignment can also be specified in some text nodes, for example SoText2 and SoText3, using the justification field. The value in the text node's field is used unless that field is explicitly set to INHERIT. To allow SoTextProperty to control horizontal justification, set the text node's justification field to INHERITED.

The application can also request use of font kerning using the kerning field. Kerning consists of modifying the spacing between two successive glyphs according to their outlines. For examples, a "T" and a "y" can be moved closer together as the top of the "y" fits nicely under the upper right bar of the "T". Kerning depends on the specific font being used.

Different text rendering styles such as underline, strikethrough and background rectangle can be specified using the style field. A color can be specified for each style using the styleColors field. The current material does not affect the color of a text rendering style unless the corresponding value in the styleColorsUseCurrentMaterial field is set to true. Text rendering styles apply to the entire string.

Text rendering effects
textProperties.png

Notes:

FILE FORMAT/DEFAULT

ACTION BEHAVIOR

SEE ALSO

SoAnnoText3, SoText3, SoText2, SoAsciiText, SoFont

See related examples:

TextProperties


Member Enumeration Documentation

Possible horizontal alignment values.

Enumerator:
LEFT 

Left edges of all strings are aligned.

(default)

CENTER 

Horizontal centers of all strings are aligned.

RIGHT 

Right edges of all strings are aligned.

Possible vertical alignment values.

Enumerator:
TOP 

Top edges of all strings are aligned.

HALF 

Vertical centers of all strings are aligned.

BASE 

All strings are aligned on their baseline.

(default)

BOTTOM 

Bottom edges of all strings are aligned.

Possible text orientation values.

Enumerator:
LEFT_TO_RIGHT 

Text string is left to right oriented.

(default)

RIGHT_TO_LEFT 

Text string is right to left oriented.

TOP_TO_BOTTOM 

Text string is top to bottom oriented.

BOTTOM_TO_TOP 

Text string is bottom to top oriented.

TextProperty style values.

Enumerator:
NONE 

No effects.

UNDERLINE 

UNDERLINE.

STRIKETHROUGH 

STRIKETHROUGH.

DOUBLE_STRIKETHROUGH 

DOUBLE_STRIKETHROUGH.

BACK_FRAME 

BACK_FRAME.

BACK_FRAME_LINE 

BACK_FRAME_LINE.

OVERLINE 

OVERLINE.

Index values for setting colors in the styleColors field.

Enumerator:
UNDERLINE_COLOR 

UNDERLINE_COLOR.

STRIKETHROUGH_COLOR 

STRIKETHROUGH_COLOR.

DOUBLE_STRIKETHROUGH_COLOR 

DOUBLE_STRIKETHROUGH_COLOR.

BACK_FRAME_COLOR 

BACK_FRAME_COLOR.

BACK_FRAME_LINE_COLOR 

BACK_FRAME_LINE_COLOR.

OVERLINE_COLOR 

OVERLINE_COLOR.

NUM_EFFECTS_COLORS 

NUM_EFFECTS_COLORS.


Constructor & Destructor Documentation

SoTextProperty::SoTextProperty (  ) 

Text property constructor.


Member Function Documentation

static SoType SoTextProperty::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoNode.

virtual SoType SoTextProperty::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoNode.

virtual SbBool SoTextProperty::isOverride (  )  const [inline, virtual]

Returns the state of the override field.

Reimplemented from SoNode.

virtual void SoTextProperty::setOverride ( const SbBool  state  )  [inline, virtual]

Set the state of the override field.

see SoNode::setOverride doc.

Reimplemented from SoNode.


Member Data Documentation

Defines the anti-aliasing factor to apply to the textured text rendering.

Default is 1.0. Default value can be changed using the environment variable OIV_TEXT_ALIASING_FACTOR.

The anti-aliasing applied transfer functions are:

  • if aliasingFactor <= 1.0 => Max( (v + f - 1) / f , 0.0)
  • if aliasingFactor > 1.0 => Min( (v * f) , 1.0)

A value of 0 essentially turns off antialiasing. Only pixels that are full opacity will be rendered. Value 1 is the native antialiasing provided by the FreeType library. Values < 1 scale down the opacity of semi-transparent pixels, so lower opacity pixels become completely transparent, effectively making the character glyphs sharper but narrower. Values > 1 scale up the opacity of semi-transparent pixels, effectively making the characters sharper but wider. Values greater than 5 have little additional visual effect.

Indicates horizontal placement and alignment of strings.

Use the AlignmentH enum. Default value is LEFT. With LEFT alignment, the left edge of the first line is at the (transformed) origin, and all left edges are aligned. RIGHT alignment is similar. CENTER alignment places the center of the first string at the (transformed) origin, with the centers of all remaining strings aligned under it. Default value can be changed using the environment variable OIV_TEXT_ALIGNMENTH.

Note: This field is only effective when the justification field of a text node is set to INHERITED. When orientation is vertical, horizontal alignment is only applied on the first line.

Indicates vertical placement and alignment of strings.

Use the AlignmentV enum. Default is BASE. With TOP alignment, the top edge of the first line is at the (transformed) origin, and all top edges are aligned. BOTTOM alignment is similar. HALF alignment places the center of the first string at the (transformed) origin, with the centers of all remaining strings aligned under it. Default value can be changed using the environment variable OIV_TEXT_ALIGNMENTV. When orientation is horizontal, vertical alignment is only applied on the first line.

Defines the width of the line when BACK_FRAME_LINE has been enabled for the current style.

The backFrameLineWidth value is pixel size for SoText2 text, and is a 1/40 of the current font size for SoText3 text. Default value is 1.0 Default value can be changed using the environment variable OIV_TEXT_BACKFRAMELINE_WIDTH.

NOTE: field available since Open Inventor 9.2

This field specifies the spacing between individual characters.

The value is in font size units for 2D text (SoText2) and 3D text (SoText3). Default is 0.

  • 0 means no extra space with respect to the standard spacing defined in the font.
  • A positive value is added to the default spacing (it is not relative or proportional).
  • Negative values are ignored.

Enables the accumulation rendering mode for SoText3 nodes.

Default is false. Accumulation mode significantly improves performance for scene graphs containing many SoText3 nodes. There are some drawbacks and limitations:

  • In Polygon mode, the accumulation takes time so the first rendering will be longer, and has a memory overhead.
  • Since the feature is based on an accumulation process, if you plan to often update the scene graph it will not fit your needs.
  • SoDepthOffset is not supported.
  • Transparency is not well supported for now.

Default value can be changed using the environment variable OIV_TEXT_ACCUMULATION. NOTE: field available since Open Inventor 9.8

Set this field to TRUE to apply kerning on text rendering.

For more information about kerning, refer to the FreeType documentation located at http://www.freetype.org/freetype2/documentation.html Default value is FALSE.

Set a margin (extra space) to apply around the text string for the BACK_FRAME and BACK_FRAME_LINE styles.

The margin value is specified as a fraction of the font size. Default value is 0.0. Default value can be changed using the environment variable OIV_TEXT_MARGIN. NOTE: field available since Open Inventor 8.1

Specifies the text rendering orientation.

Use the Orientation enum. Default is LEFT_TO_RIGHT. Default value can be changed using the environment variable OIV_TEXT_ORIENTATION.

Specifies zero or more styles to be applied to text.

Use the Style enum. Default is NONE.

Note: UNDERLINE, STRIKETHROUGH and DOUBLE_STRIKETHROUGH are not implemented for vertical oriented text ( ie: Orientation set to TOP_TO_BOTTOM or BOTTOM_TO_TOP).

NOTE: field available since Open Inventor 8.1

Specifies the color to use for each style.


Use the index values defined in the StyleColor enum (NOT the Style enum) to assign the color to the desired style. For example, assign opaque red to the underline color.

   SoTextProperty* node = new SoTextProperty();
   pNode->styleColors.set1Value( SoTextProperty::UNDERLINE_COLOR, SbColorRGBA(1,0,0,1) );

Default is (0.8,0.8,0.8,1) = the Open Inventor default diffuse color with alpha=1 (opaque).

NOTE: field available since Open Inventor 8.1

This field allows to use the current SoMaterial instead of the value specified by styleColors for each available style (default gray).

For example, if the entry corresponding to UNDERLINE_COLOR is set to TRUE, underline will be rendered using the color inherited from SoMaterial. This is convenient if (as usual) the underline should be the same color as the text. Use the index values defined in the StyleColor enum (NOT the Style enum) to set the value for the desired style (see example code for styleColors field). NOTE: field available since Open Inventor 9.4

Defines a quality range of values taken into account during textured text texture computation.

The size of the generated textures depends on this range, expressed in terms of DPI, and depends on the SoComplexity::value. Default is 150 to 300. Default range values can be changed using the environment variables OIV_MIN_TEXTURED_FONT_RES and OIV_MAX_TEXTURED_FONT_RES.

NOTE: field available since Open Inventor 8.1


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 11 Nov 2019
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/