Docs could be clearer on when we should have to define styles #11581
Labels
e1-hours
Effort: < 8 hrs
from.page-issue
Reported in a reader-filed concern
p2-medium
Necessary but not urgent concern. Resolve when possible.
review.copy
Awaiting Copy Review
Page URL
https://docs.flutter.dev/cookbook/design/fonts/
Page source
https://github.com/flutter/website/tree/main/src/content/cookbook/design/fonts.md
Describe the problem
The website describes how to use custom fonts, but it says:
The wording here implies that it's optional, it says we
can apply
not that weshould apply
.For example, if I have imported
Raleway-Regular.ttf
,Raleway-Italic.ttf
, andRobotoMono-Bold.ttf
, will Flutter automatically understand that a font file ending withItalic
is theitalic
style, or do I have to define it?The text mentions that when Flutter doesn't have the proper definition, then Flutter will try to force a visual distortion that might look bad, but it's not clear how far can Flutter infer the options, and avoiding all of that boiler plate while defining fonts it's very welcomed.
For example, here's what I have to add to configure one typeface that my design team wants to use:
If the docs made it clear that I can avoid typing all of this, then this would save me some time. (I have thought about testing this, but I am not sure if I would be able, as Flutter will distort my fonts to try to comply with my style selection, and I rather have a documented answer).
As an extra, maybe I got this wrong, but the doc firstly explains the difference between a typeface and a font, which for me it appears that a typeface is a collection of fonts, and a font is only one file, like
RobotoMono-Bold.ttf
, but then the rest of the document only uses the word "font", which I feel like in many places maybe it was meaning more "typeface".Expected fix
Clarify if we always have to define the style and weight for each font that's being imported, or if Flutter has some basic rules and applies them by default and we don't have to worry.
Additional context
The Google Fonts package docs says that if the fonts are in a specific format, then we don't have to worry about defining the styles and fonts, but it's not clear if this is a feature from the package or if Flutter itself is handling this.
I would like to fix this problem.
The text was updated successfully, but these errors were encountered: