Skip to content

Conversation

@julioest
Copy link
Collaborator

@julioest julioest commented Nov 19, 2025

Problem:

Fonts load late, causing a flash of unstyled text (FOUT) on initial page load.

Solution:

Add head-fonts.hbs partial with Font Loading API, preload fonts, and 3-second timeout fallback to ensure fonts load before content is visible.

Changes:

  • New head-fonts.hbs partial with preload links, Font Loading API implementation, and timeout logic

Impact:

Eliminates FOUT, fonts load earlier, graceful fallback for older browsers, better perceived performance.

@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-12-18 21:38:08 UTC

@julioest julioest force-pushed the fix/reduce-fout-add-font-preload branch 3 times, most recently 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

julioest commented Nov 19, 2025

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 boostorg/boostlook#147 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.
@julioest julioest force-pushed the fix/reduce-fout-add-font-preload branch from af07875 to 70339ea Compare December 3, 2025 21:18
@julioest julioest force-pushed the fix/reduce-fout-add-font-preload branch 4 times, most recently from 6ccf36a to 29e6f11 Compare December 18, 2025 21:19
@julioest julioest force-pushed the fix/reduce-fout-add-font-preload branch from 29e6f11 to 7cff046 Compare December 18, 2025 21:30
@julioest julioest merged commit ac11ba2 into boostorg:develop Dec 18, 2025
4 checks passed
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