Class: FontStyle

X3D: 3.3
Component: Text
fully implemented

.nodeTypes. FontStyle

The FontStyle node defines the size, family, and style used for Text nodes, as well as the direction of the text strings and any language-specific rendering techniques used for non-English text.

HTML Encoding and Default Values

<FontStyle family='['SERIF']' horizontal='true' justify='['BEGIN', 'FIRST']' language='""' leftToRight='true' metadata='X3DMetadataObject' quality='2.0' size='1.0' spacing='1.0' style='"PLAIN"' topToBottom='true' ></FontStyle>




Constructor for FontStyle

Name Type Argument Default Description
ctx Object <optional>
null context object, containing initial settings like namespace


These are the X3D / X3DOM fields of this node. Values should usually be received / set as strings via DOM functions (i.e., using setAttribute("myFieldName", "myFieldValue") and getAttribute("myFieldName")).
Name Type Default Value Range Inheritance Standard Description
family MFString ['SERIF'] Defines the text family.
horizontal SFBool true Specifies whether the text is shown horizontally or vertically.
justify MFString ['BEGIN', 'FIRST'] ["BEGIN","END","FIRST","MIDDLE",""] Specifies where the text is anchored. The default of ["BEGIN", "FIRST"] is the ISO spec. default. It deviates from ["MIDDLE", "MIDDLE"], the older x3dom default which may require scene tuning.
language SFString "" The language field specifies the context of the language for the text string in the form of a language and a country in which that language is used.
leftToRight SFBool true Specifies whether the text is shown from left to right or from right to left.
metadata SFNode X3DMetadataObject X3DNode Field to add metadata information
quality SFFloat 2.0 [0, inf] Sets the quality of the text rendering as an oversampling factor.
size SFFloat 1.0 [0, inf] Sets the size of the text.
spacing SFFloat 1.0 [0, inf] Sets the spacing between lines of text, relative to the text size.
style SFString "PLAIN" ["PLAIN","BOLD","ITALIC","BOLDITALIC",""] Sets the text style.
topToBottom SFBool true Specifies whether the text flows from top to bottom or from bottom to top.