-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
[FR]: Fonts weight #483
Comments
We need to create new classes for fonts if we want to include font-weight. It would be great if you could provide your idea about how you imagine the font-weight works. |
After giving this some thought, I believe the best approach would be to introduce a new set of classes that represent font-weight variations. This approach would maintain the existing code structure and functionality while providing a clean and extensible way to handle font-weights. Specifically, I propose the following implementation:
flutter:
fonts:
- family: Roboto
fonts:
- asset: fonts/Roboto-Regular.ttf
weight: 400
- asset: fonts/Roboto-Bold.ttf
weight: 700
- asset: fonts/Roboto-Light.ttf
weight: 300
Text(
'Regular Text',
style: TextStyle(fontFamily: RobotoRegularFont().family),
)
Text(
'Bold Text',
style: TextStyle(fontFamily: RobotoBoldFont().family),
)
This approach would provide a robust and type-safe way to handle font-weights while maintaining the existing code generation and usage patterns. It would also ensure that the font-weight information is correctly propagated from the Additionally, this implementation would be extensible, allowing for future enhancements such as support for font-stretch, font-style, or other font-related properties. |
Is there an existing issue for this?
Describe the problem
Hi. Generated fonts do not have weight and ignore given weight inside pubspec.yaml.
Please add weight to fonts
Describe the solution
Add weight to fonts
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: