Class dnx.lr.node.TextNode
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.lr.node.TextNode

java.lang.Object
   |
   +----dnx.util.DNXObject
           |
           +----dnx.lr.Node
                   |
                   +----dnx.lr.SubsidiaryNode
                           |
                           +----dnx.lr.GeometryNode
                                   |
                                   +----dnx.lr.node.TextNode

public class TextNode
extends GeometryNode
implements ModelSource
 Text {
    exposedField MFString     string          []
    exposedField SFNode       fontStyle       NULL
    exposedField MFFloat      length          []
    exposedField SFFloat      maxExtent       0.0
 }

The Text node specifies a two-sided, flat text string object positioned in the X-Y plane of the local coordinate system based on values defined in the fontStyle field (see FontStyle node). Text nodes may contain multiple text strings specified using the UTF-8 encoding as specified by the ISO 10646-1:1993 standard (http://www.iso.ch/cate/d18741.html). Due to the drastic changes in Korean Jamo language, the character set of the UTF-8 will be based on ISO 10646-1:1993 plus pDAM 1 - 5 (including the Korean changes). The text strings are stored in visual order.

The text strings are contained in the string field. The fontStyle field contains one FontStyle node that specifies the font size, font family and style, direction of the text strings, and any specific language rendering techniques that must be used for the text.

The maxExtent field limits and scales all of the text strings if the length of the maximum string is longer than the maximum extent, as measured in the local coordinate space. If the text string with the maximum length is shorter than the maxExtent, then there is no scaling. The maximum extent is measured horizontally for horizontal text (FontStyle node: horizontal=TRUE) and vertically for vertical text (FontStyle node: horizontal=FALSE). The maxExtent field must be >= 0.0.

The length field contains an MFFloat value that specifies the length of each text string in the local coordinate space. If the string is too short, it is stretched (either by scaling the text or by adding space between the characters). If the string is too long, it is compressed (either by scaling the text or by subtracting space between the characters). If a length value is missing--for example, if there are four strings but only three length values--the missing values are considered to be 0.

For both the maxExtent and length fields, specifying a value of 0 indicates to allow the string to be any length.

Textures are applied to text as follows. The texture origin is at the origin of the first string, as determined by the justification. The texture is scaled equally in both S and T dimensions, with the font height representing 1 unit. S increases to the right, and T increases up.

ISO 10646-1:1993 Character Encodings

Characters in ISO 10646 are encoded in multiple octets. Code space is divided into four units, as follows:

 +-------------+-------------+-----------+------------+
 | Group-octet | Plane-octet | Row-octet | Cell-octet |
 +-------------+-------------+-----------+------------+
 

The ISO 10646-1:1993 allows two basic forms for characters:

  1. UCS-2 (Universal Coded Character Set-2). Also known as the Basic Multilingual Plane (BMP). Characters are encoded in the lower two octets (row and cell). Predictions are that this will be the most commonly used form of 10646.
  2. UCS-4 (Universal Coded Character Set-4). Characters are encoded in the full four octets.

In addition, three transformation formats (UCS Transformation Format (UTF) are accepted: UTF-7, UTF-8, and UTF-16. Each represents the nature of the transformation - 7-bit, 8-bit, and 16-bit. The UTF-7 and UTF-16 can be referenced in the Unicode Standard 2.0 book.

The UTF-8 maintains transparency for all of the ASCII code values (0...127). It allows ASCII text (0x0..0x7F) to appear without any changes and encodes all characters from 0x80.. 0x7FFFFFFF into a series of six or fewer bytes.

If the most significant bit of the first character is 0, then the remaining seven bits are interpreted as an ASCII character. Otherwise, the number of leading 1 bits will indicate the number of bytes following. There is always a o bit between the count bits and any data.

First byte could be one of the following. The X indicates bits available to encode the character.

  0XXXXXXX only one byte   0..0x7F (ASCII)
  110XXXXX two bytes       Maximum character value is 0x7FF
  1110XXXX three bytes     Maximum character value is 0xFFFF
  11110XXX four bytes      Maximum character value is 0x1FFFFF
  111110XX five bytes      Maximum character value is 0x3FFFFFF
  1111110X six bytes       Maximum character value is 0x7FFFFFFF
 

All following bytes have this format: 10XXXXXX

A two byte example. The symbol for a register trade mark is "circled R registered sign" or 174 in ISO/Latin-1 (8859/1). It is encoded as 0x00AE in UCS-2 of the ISO 10646. In UTF-8 it is has the following two byte encoding 0xC2, 0xAE.

See "Concepts - Lighting Model" for details on VRML lighting equations and how Appearance, Material and textures interact with lighting.

The Text node does not perform collision detection.


Variable Index

 o fontStyle
 o length
 o maxExtent
 o string

Constructor Index

 o TextNode()

Method Index

 o boundingBoxHasChanged(Field)
Meant to be overridden by subclasses.
 o createNodeDefinition(NodeDefinition)
Create the node definition.
 o initFields()
Initialize field values.
 o recomputeBoundingBox(BoundingBox3)
Meant to be overridden by subclasses; compute the bounding box and store into the argument.
 o sendModelData(Model)

Variables

 o string
  public MFString string
 o fontStyle
  public SFNode fontStyle
 o length
  public MFFloat length
 o maxExtent
  public SFFloat maxExtent

Constructors

 o TextNode
  public TextNode()

Methods

 o createNodeDefinition
  protected void createNodeDefinition(NodeDefinition def)
Create the node definition.
Overrides:
createNodeDefinition in class Node
 o initFields
  protected void initFields()
Initialize field values.
Overrides:
initFields in class Node
 o sendModelData
  public int sendModelData(Model model)
Overrides:
sendModelData in class GeometryNode
 o recomputeBoundingBox
  public void recomputeBoundingBox(BoundingBox3 box)
Meant to be overridden by subclasses; compute the bounding box and store into the argument.
Overrides:
recomputeBoundingBox in class Node
 o boundingBoxHasChanged
  public boolean boundingBoxHasChanged(Field f)
Meant to be overridden by subclasses.
Overrides:
boundingBoxHasChanged in class Node

All Packages  Class Hierarchy  This Package  Previous  Next  Index