-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Configured font weights do not align with custom font #50216
Copy link
Copy link
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: assetsPackaging, accessing, or using assetsPackaging, accessing, or using assetsa: typographyText rendering, possibly libtxtText rendering, possibly libtxtd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/frameworkflutter/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
Description
Activity
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: assetsPackaging, accessing, or using assetsPackaging, accessing, or using assetsa: typographyText rendering, possibly libtxtText rendering, possibly libtxtd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/frameworkflutter/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
I have a typeface with multiple weights I want access to, and font files for each of these weights. I've configured
pubspec.yamlwith those weights, but they are not used when the identicalFontWeightis used in aTextStyle.pubspec:
If I then used
FontWeight.boldin aTextStyle, the 900 weight is used instead. This does not line up with the documentation on using custom fonts here: https://flutter.dev/docs/cookbook/design/fonts#pubspecyaml-option-definitionsShould the documentation be updated, or is this an issue that should be fixed in the framework?
There is a workaround: two fonts. I configured one font with the "common" weights (400/700), and a second with the "extreme" weights (200/900), treated as 400/700: