-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Configured font weights do not align with custom font #50216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @Schoonology I'm using master channel and I'm not experiencing the issue with the code and changing number of FontWeight code
|
Flutter doctor output:
As far as the code you're using, @VladyslavBondarenko , the example I gave and the issue I'm having is for a To reiterate, I'm using a typeface with fonts provided for weights 200, 400, 700, and 900. If I configure 200 or 400 as the desired weight for text, the 400 weight is used instead. If I configure 700 as the desired weight for text, the 900 weight is used instead. |
@Schoonology |
Currently the font for a requested weight is selected based on the weight metadata defined within the font itself. The weight in The documentation should be updated to reflect this. |
Found explanation here
Redirected to flutter/website#3591 (comment) |
Any way to force font to have a different weight ? For example this kind of font (https://blogfonts.com/orgon) appear like this : |
Stumbled upon this issue while trying to wrap my head around custom font weight. If the weight in pubsec.yaml is ignored, then what is the point of even defining it in the file? Is it only for descriptive purposes? Do I have to check metadata of all the custom fonts just to make sure? Seems counter-productive to me. Hope someone has a good answer to this question. |
I'd like to add to this that... Flutter forces weights to be multiples of One issue to take into account here is that the usWeightClass metadata entry in a font file allows for any value between It would indeed be great if the weights from |
…144607) flutter/engine@d514a30...17a4b66 2024-03-05 [email protected] Roll Skia from a577399ed6fb to 5839a94bf28b (1 revision) (flutter/engine#51194) 2024-03-05 [email protected] [Impeller] Turn off StC. (flutter/engine#51191) 2024-03-05 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reland: [macOS] Use CVDisplayLink to drive repaint (#51126)" (flutter/engine#51192) 2024-03-05 [email protected] Roll Skia from 9c62e7b382cf to a577399ed6fb (1 revision) (flutter/engine#51190) 2024-03-05 [email protected] Reland "Remove migration flag and unused header files #50216" (flutter/engine#50259) 2024-03-05 [email protected] Shift git version fetching to tools/gn (flutter/engine#51175) 2024-03-05 [email protected] [fuchsia] Remove now unnecessary diagnostics directory (flutter/engine#51180) 2024-03-05 [email protected] [Impeller] Enable depth buffer clipping & Stencil-then-Cover path rendering. (flutter/engine#50856) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
I have a typeface with multiple weights I want access to, and font files for each of these weights. I've configured
pubspec.yaml
with those weights, but they are not used when the identicalFontWeight
is used in aTextStyle
.pubspec:
If I then used
FontWeight.bold
in 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:
The text was updated successfully, but these errors were encountered: