Repository navigation
[google_fonts] Reduce size #184337
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: google_fontsPackage to use fonts from fonts.google.com. Supports HTTP fetching, caching, and asset bundling.Package to use fonts from fonts.google.com. Supports HTTP fetching, caching, and asset bundling.packageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Description
Activity
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: google_fontsPackage to use fonts from fonts.google.com. Supports HTTP fetching, caching, and asset bundling.Package to use fonts from fonts.google.com. Supports HTTP fetching, caching, and asset bundling.packageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Use case
I'm wondering if there is any ongoing work to potentially reduce the size of the google_fonts package.
flutter build apk --analyze-size --target-platform=android-arm64gives me this result :7MB is enormous, almost twice the size of the flutter package itself. And I'm not even on the latest google_fonts.
Proposal
Is there an alternative to google_fonts that will only download the font as needed and not include all the code in such files as google_fonts_parts/part_b.dart and google_fonts_all_parts.dart ? We'd have to use the getFont('Font') only which would download as needed. Basically, remove the static data and keep only the dynamic path.