In chapter 2, the font “Palatino” is used. When building the app on a Linux system (PopOS) this font does not seem to be installed. When a font is not found in Flutter it gives an ugly error (nothing related to fonts but actually about bounding boxes and infinite heights).
I’m sure I could install it and it would work just fine but wanted to suggest on the next update to the book that you use a font that is available on all platforms since the error is so obscure. Or maybe an opportunity to show how to use custom fonts bundled with the app or something.
1 Like
We’ll look into this. Are you aware of any font that is available on all platforms?
There are fonts like Arial, Times New Roman, Helvetica which are available on almost all platforms but they don’t look as good, using the default font - ‘Roboto’ for Material and ‘San Fransisco’ for Cupertino would be better or if special font is required, the package google_fonts should be used.
I’m not expert on fonts but a quick web search gave me this table:
http://www.apaddedcell.com/sites/www.apaddedcell.com/files/fonts-article/final/index.html
I gave “Verdana” a try and confirmed it worked on Linux, Android (emulator) and web just fine. Since the goal of the exercise it to show a custom font we probably don’t want to use the default font (Roboto) but as @mayank9018 suggested it might be a good opportunity to show how to incorporate custom fonts such as google_fonts.
Alternatively I saw this blog article which shows how to package your own font with the app:
So you could include a font with the assets (licensed correctly of course) in the book materials and show how a custom font can be packaged with the app and used.
1 Like