H3D::X3DFontStyleNode Class Reference
[Abstract nodes.]

This abstract node type is the base node type for all FontStyle nodes. More...

#include <H3D/X3DFontStyleNode.h>

Inheritance diagram for H3D::X3DFontStyleNode:

Inheritance graph

List of all members.

Public Types

enum  Alignment
 Enumeration of the alignments allowed for text.
enum  Justification
 Enumeration for the different justification values allowed.

Public Member Functions

 X3DFontStyleNode (Inst< SFNode > _metadata=0)
 Constructor.
virtual void buildFonts ()
 Build Character instances for all characters that will be allowed for use by this font node.
bool fontsBuilt ()
 Returns true if buildFonts has been called, false otherwise.
virtual bool isTopToBottom ()
 Returns true if the text should be rendered from top to bottom, false otherwise.
virtual bool isLeftToRight ()
 Returns true if the text should be rendered from left to right, false otherwise.
virtual H3DFloat getSpacing ()
 Returns the spacing between lines of text.
virtual Alignment getAlignment ()
 Gets the alignment of the text.
virtual Justification getMajorJustification ()
 Gets the justification of the text in the major alignment direction.
virtual Justification getMinorJustification ()
 Gets the justification of the text in the minor alignment direction.
virtual void renderChar (unsigned char c)
 Render the given character with this font.
virtual Vec3f charDimensions (unsigned char c)
 Get the dimensions in metres of the character given when rendered with this font.
virtual H3DFloat ascender ()
 Returns how many metres in the the positive y-direction from the origin the characters of this font use.
virtual H3DFloat descender ()
 Returns how many metres in the the negative y-direction from the origin the characters of this font use.
Vec3f stringDimensions (const string &text, Alignment alignment)
 Given a text string and an alignment of the text the function returns the dimensions of the bounding box of the 3d representation of the text using this font.
Vec3f stringDimensions (const vector< string > &text, Alignment alignment, const vector< H3DFloat > &length=vector< H3DFloat >())
 Given a vector of text string and an alignment of the text the function returns the dimensions of the bounding box of the 3d representation of the text using this font.
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value.

Protected Attributes

bool fonts_built
 True if buildFonts has been called.


Detailed Description

This abstract node type is the base node type for all FontStyle nodes.


Member Function Documentation

virtual H3DFloat H3D::X3DFontStyleNode::ascender (  )  [inline, virtual]

Returns how many metres in the the positive y-direction from the origin the characters of this font use.

Reimplemented in H3D::FontStyle.

virtual void H3D::X3DFontStyleNode::buildFonts (  )  [inline, virtual]

Build Character instances for all characters that will be allowed for use by this font node.

Characters are to be put into the characters vector using its own value as an index. Also buildFonts has to be set to true when defining this function.

Reimplemented in H3D::FontStyle.

Referenced by H3D::Text::render(), and H3D::Text::SFBound::update().

virtual Vec3f H3D::X3DFontStyleNode::charDimensions ( unsigned char  c  )  [inline, virtual]

Get the dimensions in metres of the character given when rendered with this font.

Reimplemented in H3D::FontStyle.

Referenced by H3D::Text::justifyLine(), H3D::Text::renderTextLine(), and stringDimensions().

virtual string H3D::X3DFontStyleNode::defaultXMLContainerField (  )  [inline, virtual]

Returns the default xml containerField attribute value.

For this node it is "fontStyle".

Reimplemented from H3D::Node.

virtual H3DFloat H3D::X3DFontStyleNode::descender (  )  [inline, virtual]

Returns how many metres in the the negative y-direction from the origin the characters of this font use.

Reimplemented in H3D::FontStyle.

Referenced by H3D::Text::justifyLine(), H3D::Text::justifyMinor(), and H3D::Text::SFBound::update().

virtual H3DFloat H3D::X3DFontStyleNode::getSpacing (  )  [inline, virtual]

Returns the spacing between lines of text.

See FontStyle for more details.

Reimplemented in H3D::FontStyle.

Referenced by H3D::Text::moveToNewLine(), and stringDimensions().

virtual bool H3D::X3DFontStyleNode::isLeftToRight (  )  [inline, virtual]

Returns true if the text should be rendered from left to right, false otherwise.

Reimplemented in H3D::FontStyle.

Referenced by H3D::Text::justifyLine(), H3D::Text::justifyMinor(), H3D::Text::moveToNewLine(), H3D::Text::render(), H3D::Text::renderTextLine(), and H3D::Text::SFBound::update().

virtual bool H3D::X3DFontStyleNode::isTopToBottom (  )  [inline, virtual]

Returns true if the text should be rendered from top to bottom, false otherwise.

Reimplemented in H3D::FontStyle.

Referenced by H3D::Text::justifyLine(), H3D::Text::justifyMinor(), H3D::Text::moveToNewLine(), H3D::Text::renderTextLine(), and H3D::Text::SFBound::update().

Vec3f X3DFontStyleNode::stringDimensions ( const vector< string > &  text,
Alignment  alignment,
const vector< H3DFloat > &  length = vector< H3DFloat >() 
)

Given a vector of text string and an alignment of the text the function returns the dimensions of the bounding box of the 3d representation of the text using this font.

A vector specifying the length of the text fields as in the Text node. If this is specified this length will be used as length for as many strings in text as there are values in length.

References getSpacing(), and stringDimensions().

Vec3f X3DFontStyleNode::stringDimensions ( const string &  text,
Alignment  alignment 
)

Given a text string and an alignment of the text the function returns the dimensions of the bounding box of the 3d representation of the text using this font.

References charDimensions().

Referenced by H3D::Text::justifyLine(), H3D::Text::justifyMinor(), H3D::Text::moveToNewLine(), H3D::Text::render(), H3D::Text::scaleToMaxExtent(), stringDimensions(), and H3D::Text::SFBound::update().


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

Generated on Fri Nov 7 10:31:26 2008 for H3D API by  doxygen 1.5.7