X3D Example Archives: Conformance Nist, Appearance, Font Style

 

FontStyle is an X3DFontStyleNode that defines the size, family, justification, and other styles used by Text nodes. Hint: full internationalization (i18n) and localization (l10n) features are available for any written language.

X3D Tooltips of interest: FontStyle.

X3D Specification sections of interest: 15 Text component, 15.2 Concepts, 15.2.2 Text formatting, 15.4.1 FontStyle and 15.4.2 Text.

X3D Examples Archives of related interest:

 
  7 X3D Models       X3D Model Descriptions
   default_fontstyle default fontstyle Test default FontStyle rendering. A FontStyle node with default values for all of its fields is used to render three lines of a Text geometry. Horizontal lines in this world are spaced 1 unit apart. The green lines represent the X and Y axes of the local coordinate system. With a default "family" value of SERIF, the text should be be a SERIF family font. With "horizontal" equal to true, the text should be parallel to the X axis, and advance in the positive X direction. With "justify" = [BEGIN,"FIRST"], the text should be justified at the left edge of the line. With "leftToRight" = true, text should advance in a "left to right" direction along the major (X) axis. With a default font "size" of 1, the nominal font "glyph" height should be 1 unit in the local coordinate system. This corresponds to the distance between successive horizontal lines in this world. With a default font "spacing" of 1, the distance between the base of two succesive Text lines should be 1 unit in the local coordinate system. With a default "style" of PLAIN, the text should not appear bold, or italic, or bold and italic. With a default "topToBottom" value of true, successive lines of text should advance from top to bottom along the minor (Y) axis.
   driver driver Test all possible combinations of "horizontal", "justify", "leftToRight" and "topToBottom" for major and minor Text axes. The viewer can select any combination of buttons and verify the correct Text orientation and spacing using the example images to the left of the browser window.
   family family Test range of family values for FontStyle node. A FontStyle node with default values for all of its fields is used to render three lines of a Text geometry. Horizontal lines in this world are spaced 1 unit apart. The green lines represent the X and Y axes of the local coordinate system. With a default family="SERIF", the text should be be a SERIF family font. With horizontal="true", the text should be parallel to the X axis, and advance in the positive X direction. With justify='"BEGIN" "FIRST" ', the text should be justified at the left edge of the line. With leftToRight="true", text should advance in a left to right direction along the major (X) axis. With a default font size="1", the nominal font glyph height should be 1 unit in the local coordinate system. This corresponds to the distance between successive horizontal lines in this world. With a default font spacing="1", the distance between the base of two succesive Text lines should be 1 unit in the local coordinate system. With a default style="PLAIN", the text should not appear bold, or italic, or bold and italic. With a default topToBottom="true", successive lines of text should advance from top to bottom along the minor (Y) axis.
   next_family next family Test FontStyle node ability to go to next family in attribute list. A "family" type of "NONEXISTENT" is supplied to a FontStyle node, followed by a TYPEWRITER type. Because the browser does not support a "NONEXISTENT" family type, it should proceed to the next supported type (TYPEWRITER) and render a 3 line text string with a TYPEWRITER family font.
   serif_family serif family Test SERIF family rendering for FontStyle node. A "family" type of "NONEXISTENT" is supplied to a FontStyle node. No other family type is contained in the MFString list. Because the browser does not support a "NONEXISTENT" family type, and no other family type is in the list, the browser should default to a "SERIF" family font, and render a 3 line text string with a SERIF family font.
   size_spacing size spacing Test different size and spacing values for FontStyle node. Three different "size" and "spacing" combinations are used here to test browser ability to properly space text both horizontally and vertically. The first test sets size = 2 and spacing = 0.5 (the red text). Distance between the base of the two text lines should be 1 unit. For the horizontal text this is measured between the bottoms of the text lines. For the vertical text, spacing is measured between the left sides of adjacent text lines. In both cases, the nominal vertical height of the fonts should be 2 units. The second test sets size = 1 and spacing = 1 (the yellow text). Distance between the base of the two text lines should be 1 unit. For the horizontal text this is measured between the bottoms of the text lines. For the vertical text, spacing is measured between the left sides of adjacent text lines. In both cases, the nominal vertical height of the fonts should be 1 unit. The first test sets size = 0.75 and spacing = 4 (the blue text). Distance between the base of the two text lines should be 3 units. For the horizontal text this is measured between the bottoms of the text lines. For the vertical text, spacing is measured between the left sides of adjacent text lines. In both cases, the nominal vertical height of the fonts should be 0.75 units.
   style style Test style attribute for FontStyle node. All three required family fonts are used to test the four "style" types of "PLAIN" (upper left quadrant), "ITALIC" (upper right quadrant), "BOLD" (lower left quadrant) and "BOLDITALIC" (lower right quadrant). Text should reflect these styles.

The X3D Resources: Examples page and Savage Developers Guide provide more information about the production of this archive.