[x3d-public] draft X3D 4.1 prose for font files and libraries
Andreas Plesch
andreasplesch at gmail.com
Thu Mar 13 15:15:23 PDT 2025
Thanks for further careful consideration and adjustments. Hopefully, it is
not too late to add to the discussion further.
If support of font collection files which contain multiple fonts is
required for full compliance, it will be important to a) show a concrete
test case perhaps with an Asian font which implementations can target and
b) fully define how the selection of the desired font out of the multiple
fonts in the file should be accomplished, eg. perhaps by an indexed order
in the file, or by one of the font family names ("full name") in the
metadata, or by another mechanism like fuzzy matching.
Thus, please consider that support for font collections is explicitly made
optional, or only guaranteed at a higher component level.
Second, in summary of the below, let me also suggest that font names,
sourced from the family field or from metadata, become name scoped to allow
for separation of Inlines, and ProtoInstances.
Third, is ordering important ? Can a FontStyle node only occur after a
FontLibray node it references (similar to USE after DEF) ?
Fuller discussion:
With the emphasis of the FontLibray.family field over the optional lookup
of a font family name in the metadata of the font file, a global scope of
FontLibray is more attractive. The way the global scope is intended to be
clearly expressed may not quite succeed:
"Fonts from FontLibrary nodes are also usable when defined within an Inline
node"
probably means that if an Inline node has a font defined in a FontLibrary
root node within it, it is usable also in the parent node. But I think this
is the opposite of the iframe case, so the sentence may actually mean the
opposite ?
In any case, the way x3dom would probably handle a global/model wide
FontLibrary scope is in two steps. First, whenever a FontLibrary node is
encountered, register/add the defined font to the master document/model.
This would be true even if encountered in an Inline or ProtoInstance. Then,
when a FontStyle references the font by a matching family name, load the
font which may or may not include downloading and then use it for
rendering. This would be also true any time and even if encountered in an
Inline or ProtoInstance.
This has the effect that the order in which FontLibrary nodes are
encountered is important. I think the order would probably play a role in
any scenario. In addition this procedure also means that font family names
would probably be name scoped to prevent leaking, similar to DEF/USE names.
A font family name then can only be used for matching within the same name
scope, eg. names can never match across name scopes.
So a parent could not impact a child's font handling and vice versa. This
complete separation would closely resemble the iframe separation which
occurs also in both directions.
Finally, I still have my doubts that these are not complications which only
appear to be a simpler and more elegant match for font resource handling
but are actually harder to understand and ultimately unnecessary.
Any feedback or thoughts appreciated,
Andreas Plesch
Waltham, MA 02453
On Thu, Mar 13, 2025, 1:12 PM Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>
wrote:
> Holger, thanks for these carefully expressed points, very convincing.
> Also thanks to others for steadily progressing dialog on this topic.
>
> Dick and I met yesterday and looked closely at how to express "scene
> scope" satisfactorily.
>
>
> - X3D 4.1 (draft) Architecture, clause 15 Text component, 15.4.1
> FontLibrary
> -
> https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD//Part01/components/text.html#FontLibrary
>
>
> Summary of latest revision follows. (color-code reminder: yellow is
> proposed, cyan is editors note)
>
>
> - FontLibrary *family *field is an important addition that resolves
> several challenges, we are ready to accept it.
>
> - Current node definition:
> - The FontLibrary node specifies a collection of one or more font
> family definitions. A font family may include one or more related font
> style definitions. FontLibrary provides the ability to selectively load
> font files for use by FontStyle
> <https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD//Part01/components/text.html#FontStyle> and
> ScreenFontStyle
> <https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD//Part01/components/layout.html#ScreenFontStyle>
> nodes.
> -
> - Proposed addition:
> - The visibility of FontLibrary fonts is scoped to the current model,
> and FontLibrary nodes are typically defined with other root nodes in a
> scene. Fonts from FontLibrary nodes are also usable when defined within an
> Inline node, or when defined among the topmost nodes of a Prototype
> instance contained in a scene.
>
>
> Keeping track of design rationale, we combined several thoughts as follows.
>
>
> - Editors note: key questions are
>
>
> 1. Whether global scope is needed for FontLibrary fonts, rather than
> just within a FontStyle node; we think yes, fonts ought to have scene scope
> for the current model.
> 2. If fonts are visible throughout a given model, then scoping a
> FontLibrary node within a FontStyle *fontLibrary* field appears to be
> superfluous. This avoids much unnecessary complication, especially if an
> author simply wants to change the value of a FontStyle *family* field.
> 3. Whether a single font file contains more than one font; yes,
> various specifications indicate that may occur for some font files.
> 4. Whether a browser might look inside the font file to check internal
> metadata and find one of multiple family names; yes that option seems like
> a good idea if no common matching *family* field is found for the
> FontStyle and FontLibrary nodes.
>
>
> Subject to group scrutiny and discussion, we are ready to
>
> -
> - Remove Example 2
> - Editors note: the *fontLibrary* fields shown in EXAMPLE 2 appear to
> be an unnecessary complication, since the approach shown in Example 1 can
> also work for each of these two scene fragments. Subject to mailing list
> discussion, we expect to delete both fragments in EXAMPLE 2.
> -
> - Remove the corresponding FontStyle *fontLibrary * field in 15.4.2
> FontStyle
>
>
> Hopefully we haven't overlooked reconciliation of any of the many prior
> discussion points. Continued scrutiny and discussion remain welcome.
>
> Feels like we are getting close to an excellent design balance. Hopefully
> others feel that way too.
>
> Have fun with fonts in X3D! 🙂
>
>
> all the best, Don
>
> --
>
> Don Brutzman Naval Postgraduate School, Code USW/Br
> brutzman at nps.edu
>
> Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA
> +1.831.656.2149
>
> X3D graphics, virtual worlds, navy robotics
> https://faculty.nps.edu/brutzman
>
>
> ------------------------------
> *From:* x3d-public <x3d-public-bounces at web3d.org> on behalf of Holger
> Seelig via x3d-public <x3d-public at web3d.org>
> *Sent:* Friday, March 7, 2025 2:42 PM
> *To:* X3D <x3d-public at web3d.org>
> *Cc:* Holger Seelig <holger.seelig at yahoo.de>; Andreas Plesch <
> andreasplesch at gmail.com>
> *Subject:* Re: [x3d-public] draft X3D 4.1 prose for font files and
> libraries
>
> I think a FontLibrary should be scene scoped and no more. An Inline scene
> should not have access to the parent scenes FontLibrary nodes registers
> fonts (via FontLibrary.family field).
>
> In HTML there is a iframe element, the document in this element can’t get
> access to the parent document, It is completely separated. One reason is
> that an iframe is often used for advertising which comes often from a
> different provider and the advertising document should not have access to
> the parent document for security reasons.
>
> I also think that FontStyle.fontLibrary is not necessary. It makes the
> code more readable if FontLibrary is a root node.
>
> Best regards,
> Holger
>
> --
> Holger Seelig
> Leipzig, Germany
>
> holger.seelig at yahoo.de
> https://create3000.github.io/x_ite/
>
> Am 07.03.2025 um 21:13 schrieb John Carlson via x3d-public <
> x3d-public at web3d.org>:
>
>
>
> On Fri, Mar 7, 2025 at 1:33 PM Brutzman, Donald (Don) (CIV) via x3d-public
> <x3d-public at web3d.org> wrote:
>
> separation of concerns, i.e. keeping url networking separate from
> FontStyle presentation, not overwhelming FontStyle functionality. Thus,
> FontStyle.*url *is simply incomplete design, and FontStyle.*fontLibrary *is
> a more-correct alternative, if we want font scope limited to a single
> FontStyle node.
>
>
> I don't understand why the same argument doesn't also apply to
> ImageTexture. I'm not seeing ImageTexture.url networking separate from
> ImageTexture presentation? Do we need an ImageLibrary?
>
> John
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250313/e707847c/attachment-0001.html>
More information about the x3d-public
mailing list