Skip to content
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

Unnecessary font downloads on the Web platform #499

Open
sashkent3 opened this issue Aug 26, 2024 · 1 comment
Open

Unnecessary font downloads on the Web platform #499

sashkent3 opened this issue Aug 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@sashkent3
Copy link

Describe the bug
Using Cyricilic (possibly any non-ASCII) characters as LoginMessages.loginButton (and likely any other AnimatedButton.text) causes Flutter Web to download the fallback font Noto Sans SC.

The bug is caused by a TextStyle which doesn't copy the fontFamily from the theme here. For example, adding fontFamily: theme.textTheme.labelLarge!.fontFamily, to the TextStyle there resolves the issue for me, however in my opinion, it's wiser to use the whole theme.textTheme.labelLarge for the style here.

To Reproduce
Steps to reproduce the behavior:

  1. Run the gist on the Flutter Web platform.
  2. Go to the Network tab of the Chromium's Developer Tools.
  3. Observe that both Roboto (the default font) and Noto Sans SC (one of the fallback fonts) are downloaded.

Expected behavior
I expected only the Roboto font to be downloaded.

Screenshots
image

Information (please complete the following information):

  • Platform: web
  • Flutter version: 3.24.1
  • Package version: 5.0.0
@sashkent3 sashkent3 added the bug Something isn't working label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@sashkent3 and others