fix(fonts): drop invalid bundled fonts that Skia refused to parse

The font files I vendored under assets/google_fonts were not fonts. A
valid TTF starts with 00 01 00 00; these started with 80 18 01 00 and
3C A3 00 00. They came from the legacy fonts.googleapis.com endpoint,
and I shipped them without checking the signature.

Skia rejected every one of them, which is what produced the console
errors seen in production:

    Failed to parse font family "Karla_regular"
    Failed to parse font family "Fraunces_600"

so the whole app rendered in a fallback font instead of Fraunces/Karla.

Removing them restores the working path: google_fonts fetches from
fonts.gstatic.com at runtime, which is what main did before.

This gives up the startup win claimed in 1feeaae. Bundling properly is
still possible but needs static per-weight instances: the only files
google/fonts publishes for these two families are variable fonts, and
google_fonts cannot map a weight onto them in asset mode. A note in
pubspec.yaml records this so the mistake is not repeated.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Opus 5 committed 2026-08-11 08:41:59 +02:00
1 parent 51e6d9d693
commit 095eb2c1b0
8 files changed
+7 -4

No files matched your search

+7 -4
View File
@@ -64,7 +64,10 @@ dev_dependencies:
flutter:
uses-material-design: true
# Polices embarquees : google_fonts detecte ces fichiers via l'AssetManifest
# et n'effectue AUCUNE requete reseau vers fonts.gstatic.com au demarrage.
assets:
- assets/google_fonts/
# NOTE : ne pas re-embarquer les polices via assets/google_fonts/ sans
# verifier la signature des fichiers (un TTF valide commence par
# 00 01 00 00). Une tentative precedente a embarque des fichiers invalides
# que Skia refusait, avec pour resultat "Failed to parse font family" et un
# rendu en police de repli. Les seuls fichiers officiels disponibles sont
# des polices VARIABLES, que google_fonts ne sait pas mapper par graisse en
# mode assets : un embarquement correct demande des instances statiques.