Repository navigation
[google_fonts] Reduce size #184337
Description
Activity
- addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Mar 31, 2026 @TheCarpetMerchant Thanks for the report!
This looks like a feature request regarding reducing the bundled size of
google_fontspackage.To better understand and make this actionable, could you please:
- Confirm if this occurs on the latest version of
google_fonts - Provide a minimal reproducible example
- Clarify how many fonts are being used in your app
Also, are you observing that unused fonts are not tree-shaken from the final build?
Thanks!
- Confirm if this occurs on the latest version of
- addedwaiting 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 respondsand removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Mar 31, 2026 * Confirm if this occurs on the latest version of `google_fonts`Yes, it's worse at 8MB
* Provide a minimal reproducible examplegoogle_fonts_sample_app
Clone and run flutter build apk --analyze-size --target-platform=android-arm64* Clarify how many fonts are being used in your appNone, users can choose (code uses
getFont()). Roboto is used by default but that's shipped with Flutter itselfAlso, are you observing that unused fonts are not tree-shaken from the final build?
No- removedwaiting 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
on Apr 2, 2026 - addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Apr 2, 2026 @TheCarpetMerchant Thanks for the clarification and providing the details.
I am able to see the same behavior locally on the latest Flutter stable version
3.41.6. Kindly refer the below result:example % flutter build apk --analyze-size --target-platform=android-arm64 ------- Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 1576 bytes (99.9% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app. Running Gradle task 'assembleRelease'... 18.4s ✓ Built build/app/outputs/flutter-apk/app-release.apk (25.2MB) ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ app-release.apk (total compressed) 24 MB ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ META-INF/ androidx 3 KB assets/ flutter_assets 370 KB classes.dex 233 KB lib/ arm64-v8a 23 MB Dart AOT symbols accounted decompressed size 13 MB package:google_fonts 8 MB package:flutter 2 MB dart:mixin_deduplication 255 KB dart:core 246 KB dart:ui 214 KB dart:typed_data 163 KB dart:io 121 KB dart:async 93 KB package:material_color_utilities 68 KB dart:collection 58 KB dart:convert 53 KB package:characters 34 KB dart:isolate 25 KB package:vector_math/ vector_math_64.dart 23 KB package:http 11 KB dart:ffi 11 KB package:crypto 9 KB package:google_fonts_tester 7 KB dart:math 3 KB package:path_provider_android 3 KB kotlin/ collections 2 KB concurrent 1 KB kotlin.kotlin_builtins 5 KB ranges 1 KB reflect 1 KB AndroidManifest.xml 2 KB res/ o-.png 1 KB resources.arsc 10 KB ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ A summary of your APK analysis can be found at: /Users/admin/.flutter-devtools/apk-code-size-analysis_02.json To analyze your app size in Dart DevTools, run the following command: dart devtools --appSizeBase=/Users/admin/.flutter-devtools/apk-code-size-analysis_02.json
Labelling this to
team-frameworkto investigate further.- addedc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.packageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework teamp: 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.and removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Apr 2, 2026 - addedP2Important issues not at the top of the work listImportant issues not at the top of the work listtriaged-frameworkTriaged by Framework teamTriaged by Framework team
on Apr 7, 2026 - addedteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages teamand removedframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
on Aug 26, 2026 - added a commit that references this issue
on Sep 4, 2026 I think this was resolve in the new Lite features in google_fonts, let us know if that is not the case!
- addedwaiting 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
on Sep 24, 2026 Forgot I had opened an issue for this, closed
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.