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

Support loading default font #1

Open
lcdsmao opened this issue Apr 13, 2021 · 2 comments
Open

Support loading default font #1

lcdsmao opened this issue Apr 13, 2021 · 2 comments

Comments

@lcdsmao
Copy link
Collaborator

lcdsmao commented Apr 13, 2021

https://pub.dev/packages/golden_toolkit#loading-fonts

By default, flutter test only uses a single "test" font called Ahem. This font is designed to show black spaces for every character and icon. This obviously makes goldens much less valuable if you are trying to verify that your app looks correct.

Here is how golden_toolkit loading roboto font:
https://github.com/eBay/flutter_glove_box/blob/master/packages/golden_toolkit/lib/src/font_loader.dart

@tomosaaan
Copy link
Member

Thanks.

Robot font supported English. So we use NotoSans 😢

Do you have any good ideas?

@fredgrott
Copy link

I do, just configure tests to use google fonts folder to load custom fonts like we do with eBAy's Golden tool kit ie by using the Golden toolkit:

Future<void> testExecutable(FutureOr<void> Function() testMain) async { return GoldenToolkit.runWithConfiguration( () async { await loadAppFonts(); await testMain(); }, config: GoldenToolkitConfiguration( // Currently, goldens are not generated/validated in CI for this repo. We have settled on the goldens for this package // being captured/validated by developers running on MacOSX. We may revisit this in the future if there is a reason to invest // in more sophistication skipGoldenAssertion: () => !Platform.isMacOS, ), ); }

That way we get more power without having to change anything in playbook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants