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 “”
Array of quoted font family names in preference order, browsers use the first supported family.
Hints
- Example family array might be “Times” “SERIF”
- Values with guaranteed support include “SERIF” “SANS” “TYPEWRITER”.
- SERIF and SANS are variable-width fonts (for example, Times Roman and Arial).
- TYPEWRITER is a fixed-width font (for example, Courier).
- MFString arrays can have multiple values, so “separate each individual string” “by using quote marks”.
- See 15.2.2.2 Font family and style for details.
- Supports supports capabilities for Web Internationalization (i18n)
- AccessType relaxed to inputOutput in order to support animation and user accessibility.
Warning
- Font family support often varies.
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 supports capabilities for Web Internationalization (i18n)
- Wikipedia
- Wikipedia
- Open-source font libraries and https://fontlibrary.org