Skip to content

Full TTF file overrides WOFF2 slices in Google Fonts #314

@tuyuritio

Description

@tuyuritio

🐛 The bug

The generated css places the @font-face rule for the full source font (e.g., ttf, woff) after the rules for the woff2 slices.

When multiple rules match the same font family and character codes, the last defined rule wins.
Since the full font covers all characters (which has no unicode-range), it overrides the specific slice rules defined earlier.

🛠️ To reproduce

The cli displayed "Could not fetch from https://fonts.google.com/metadata/fonts".

🌈 Expected behaviour

Browsers should prioritize loading the optimized woff2 slices and only use the full source font as a fallback for missing characters.

ℹ️ Additional context

The issue was observed when processing the following Google Fonts URLs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions