0

I've got a bunch of golden tests that use various custom fonts and I'm able to successfully render my custom fonts using FontLoader.addFont(...), however, I also want to have some tests using some of the built-in font families like Courier and Times New Roman.

I'm having trouble figuring out how I can make these fonts available to my golden tests though.

I assume that Flutter itself doesn't provide these fonts and that it is falling back to the operating system to provide them... so I don't have a path for an otf/ttf file to load manually.

Any theories on how I might be able to make these fonts visible, so I don't just keep getting the black Ahem boxes?

Craig Edwards
  • 2,118
  • 1
  • 18
  • 23
  • Not at all familiar with golden tests, but maybe this has something useful for you :) https://stackoverflow.com/questions/64145307/full-list-of-font-families-provided-with-flutter – RukshanJS Apr 12 '21 at 23:54
  • Yeah, that post talks about the built-in fonts within the app when you are running (which works just fine for me). However, when doing golden tests, there's a bit of magic font handling that needs to be done for custom fonts (see https://stackoverflow.com/a/62460566/501781). I'm trying to find the equivalent steps to deal with the built-in fonts like Courier – Craig Edwards Apr 13 '21 at 06:38

0 Answers0