FontLibrary
Overview
FontLibrary can load additional fonts for use by Text and FontStyle nodes.
The FontLibrary node belongs to the Text component and requires at least support level 2, its default container field is children. It is available from X3D version 4.1 or higher.
Info: Please note that this node is still experimental, i.e. the functionality of this node may change in future versions of X_ITE.
Hierarchy
1
2
+ X3DNode
+ FontLibrary (X3DUrlObject)*
* Derived from multiple interfaces.
Fields
| Type | Access Type | Name | Default Value |
|---|---|---|---|
| SFNode | [in, out] | metadata | NULL |
| SFString | [in, out] | description | ”” |
| SFString | [in, out] | family | ”” |
| SFBool | [in, out] | load | TRUE |
| MFString | [in, out] | url | [ ] |
| SFTime | [in, out] | autoRefresh | 0 |
| SFTime | [in, out] | autoRefreshTimeLimit | 3600 |
SFNode [in, out] metadata NULL [X3DMetadataObject]
Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.
Hint
SFString [in, out] description “”
Author-provided prose that describes intended purpose of the url asset.
Hint
- Many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for “ quotation-mark character).
SFString [in, out] family “”
The family field provides an identifying alias for the font in the associated file, if that file only contains a single font family (possibly with multiple styles). This field provides a reference label for the family field in a corresponding FontStyle or ScreenFontStyle node. If no family field is provided, the X3D browser can look inside the font file to determine the family name of each associated font.
Hints
- This approach for family field is similar to how CSS can identify a font family associated with a font file for corresponding use in an HTML page.
- Supports capabilities for Web Internationalization (i18n)
SFBool [in, out] load TRUE
The load field has no effect, Anchor operation is only triggered by user selection.
MFString [in, out] url [ ] [URI]
Address of replacement world, or #ViewpointDEFName within the current scene, or alternate Web resource, activated by the user selecting Shape geometry within the Anchor children nodes.
Hints
- Jump to a world’s internal viewpoint by appending viewpoint name (for example, #ViewpointName, someOtherCoolWorld.x3d#GrandTour).
- Jump to a local viewpoint by only using viewpoint name (for example, #GrandTour).
- Binding a different Viewpoint triggers an isBound event that can initiate other user-arrival reactions via event chains to interpolators or scripts.
- MFString arrays can have multiple values, so separate each individual string by quote marks “https://www.web3d.org” “https://www.web3d.org/about” “etc.”
- Alternative XML encoding for quotation mark “ is " (which is an example of a character entity).
- Can replace embedded blank(s) in url queries with %20 for each blank character.
- Pop up a new window with url value as follows: “JavaScript:window.open(‘somePage.html’,’popup’,’width=240,height=240’);location.href=’HelloWorld.x3d’”
- X3D Scene Authoring Hints, urls
Warning
- Strictly match directory and filename capitalization for http links! This is important for portability. Some operating systems are forgiving of capitalization mismatches, but http/https url addresses and paths in Unix-based operating systems are all case sensitive and intolerant of uppercase/lowercase mismatches.
SFTime [in, out] autoRefresh 0 [0,∞)
The autoRefresh field has no effect, Anchor operation is only triggered by user selection.
SFTime [in, out] autoRefreshTimeLimit 3600 [0,∞)
The autoRefreshTimeLimit field has no effect, Anchor operation is only triggered by user selection.
Supported File Formats
It is possible to specify in the url field one or more URLs of a custom font file of the following types:
| Encoding | File Extension | MIME Type |
|---|---|---|
| WOFF2 | .woff2 | font/woff2 |
| WOFF | .woff | font/woff |
| Open Type | .otf | font/otf |
| True Type | .ttf | font/ttf |
Advice
Hints
- Full Internationalization (i18n) and Localization (l10n) features are available for any written language.
- Supports capabilities for Web Internationalization (i18n)
- Wikipedia
- Wikipedia
- Open-source font libraries and https://fontlibrary.org
Warning
- X3D Architecture version 4.1 draft is experimental and not fully implemented.
Browser Compatibility
| Castle Game Engine | FreeWRL | X_ITE X3D Browser | X3D-Edit | X3DOM |
|---|---|---|---|---|