Skip to content

HTML Documentation doesn't load locally-saved fonts in macOS Safari #98769

Closed
@kadiwa4

Description

@kadiwa4

When viewing locally-saved documentation (file:///), rustdoc's output website isn't able to load in any of the woff2 fonts. Since #96279 removed the woff versions of the fonts, the browser defaults to other fonts, and it turns out Times and Menlo don't look great in combination.
Update: since #115904 (1.75.0), the bold version of Source Serif 4 is now used.

Version: macOS 12.4 / Safari 15.5 (still an issue in 17.2.1)
Rust/Rustdoc version: 1.62.0, works fine on 1.61.0

Workaround script: https://gist.github.com/kadiwa4/8e81b820217fdb8d1fb70e2108d1a58d

Web console:

[Error] Origin null is not allowed by Access-Control-Allow-Origin. Status code: 0
[Error] Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin. Status code: 0 (SourceSerif4-Regular.ttf.woff2, line 0)

... (repeated for other woff2 fonts)
Screenshot 2023-12-31 at 17 49 45

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.O-macosOperating system: macOST-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions