Class: FontStyle

X3D: 3.3
Component: Text
Status:
fully implemented

x3dom.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='['MIDDLE', 'MIDDLE']' language='""' leftToRight='true' metadata='X3DMetadataObject' quality='2.0' size='1.0' spacing='1.0' style='"PLAIN"' topToBottom='true' ></FontStyle>

Inheritance


Constructor

FontStyle(ctx)

Constructor for FontStyle

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

Fields

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 ['MIDDLE', 'MIDDLE'] ["BEGIN","END","FIRST","MIDDLE",""] Specifies where the text is anchored. The default of ["MIDDLE", "MIDDLE"] deviates from the ISO spec. default of ["BEGIN", "FIRST"] for backward compatibiliy reasons.
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 X3DFontStyleNode Field to add metadata information
quality SFFloat 0 [0, inf] Sets the quality of the text rendering as an oversampling factor.
size SFFloat 0 [0, inf] Sets the size of the text.
spacing SFFloat 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.