Skip to content

Conversation

@julioest
Copy link
Collaborator

@julioest julioest commented Nov 19, 2025

Problem

Fonts from boostlook.css load late, causing a flash of unstyled text (FOUT) on page load for libraries that use the Antora UI bundle

Solution

Add tags in the HTML to start fetching fonts early, before CSS parsing.

Changes

  • Added head-fonts.hbs partial with:
    • preconnect and dns-prefetch to https://cppalliance.org for faster DNS/TLS
    • Preload links for:
      • NotoSansDisplay.ttf (normal)
      • NotoSansDisplay-Italic.ttf (italic)
      • NotoSansMono.ttf (monospace)
  • Included head-fonts partial in head.hbs before stylesheets

Impact

  • Fonts start loading earlier in the page lifecycle
  • Reduced FOUT
  • Better perceived performance
  • No changes to CSS or JavaScript

Testing

  • Tested on macOS (Chrome, Firefox, Safari) with boost.url library and site docs. Fonts load correctly with proper style variants across all browsers.

@julioest julioest requested a review from sdarwin November 19, 2025 20:19
@julioest julioest force-pushed the fix/reduce-fout-add-font-preload branch 2 times, most recently from c513116 to bfea9f0 Compare November 19, 2025 20:37
@cppalliance-bot
Copy link

cppalliance-bot commented Nov 19, 2025

An automated preview of the documentation is available at https://545.site-docs.prtest2.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2025-11-19 23:28:41 UTC

@julioest julioest force-pushed the fix/reduce-fout-add-font-preload branch 2 times, most recently from a1d41e7 to 9d0c660 Compare November 19, 2025 20:44
@julioest julioest force-pushed the fix/reduce-fout-add-font-preload branch from 9d0c660 to 16043c5 Compare November 19, 2025 20:56
@sdarwin
Copy link
Collaborator

sdarwin commented Nov 19, 2025

@julioest this PR is adding "preload" on three NotoSans fonts. In the preview https://545.site-docs.prtest2.cppalliance.org/index.html -> View Source -> the "preload" is included in the source. So the modification is there, right? Nevertheless I still get FOUT in the browser. Do you?
You're welcome to merge this. If you believe it's correct.

@sdarwin
Copy link
Collaborator

sdarwin commented Nov 19, 2025

  • notosans.woff2 continues to 404. Twice.
  • site.webmanifest 404's once.
  • This solution is creating a dependency on the cppalliance.org website. That's alright in the short term but longer term the doc build process, using antora, should generate standalone, self-sufficient doc builds that embed the required files, and aren't contacting cppalliance.org. If possible.

Are all these "notosans" fonts the primary main fonts? If they were 404ing before, does that mean they weren't displayed? In that case, are they needed?

julioest added a commit to julioest/boostlook that referenced this pull request Nov 19, 2025
Add local font paths first in @font-face src to check for fonts
in antora-bundled projects before remote fallbacks. Required
before boostorg/website-v2-docs#545 can merge.
@julioest
Copy link
Collaborator Author

This solution is creating a dependency on the cppalliance.org website. That's alright in the short term but longer term the doc build process, using antora, should generate standalone, self-sufficient doc builds that embed the required files, and aren't contacting cppalliance.org. If possible.

100% agreed! This PR in boostlook #545 checks for the antora-bundled font path first.

notosans.woff2 continues to 404. Twice.

It's failing because there's no /static/font/notosans.woff2 (website-v2's font path)

@julioest julioest requested a review from karimarie67 November 20, 2025 00:02
julioest added a commit to boostorg/boostlook that referenced this pull request Nov 20, 2025
Add local font paths first in @font-face src to check for fonts
in antora-bundled projects before remote fallbacks. Required
before boostorg/website-v2-docs#545 can merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants