Skip to content

[google_fonts] Reduce size #184337

Description

@TheCarpetMerchant

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-arm64 gives me this result :

 lib/
    arm64-v8a                                                              32 MB
    Dart AOT symbols accounted decompressed size                           20 MB
      package:google_fonts                                                  7 MB
      package:flutter                                                       4 MB

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe 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.packageflutter/packages repository. See also p: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions