inaturalist / iNaturalistReactNative

Cross-platform version of the iNat mobile app
MIT License
63 stars 21 forks source link

Custom Fonts #159

Closed kueda closed 1 year ago

kueda commented 2 years ago

Support custom fonts in the app. Specifically, we need to answer these questions:

  1. Can we support custom fonts?
  2. Do custom fonts need to be shipped with the app binary or can they be loaded from the web?
  3. If they are loaded from the web, do they need to be reloaded from the web all the time, or can they be loaded once and then the font can be used offline?
  4. If they are loaded from the web, can they be loaded before we show any text to avoid any flicker as the font changes?
  5. If they are in the app binary, can they be extracted through decompilation?

Ideally we want to set the default font for the entire app to Whitney Book, and the font for all headers to Novel Display. Contact Abhas for the Whitney font files, but what kind of license we get for Novel Display will depend on the answers to these questions, so maybe try a few things with a font you have on hand (Comic Sans?!) and ones you can load from the web (Monoton?)

albullington commented 1 year ago
  1. We can definitely add custom fonts in RN; that's what we're doing in Seek.
  2. What's the benefit of loading fonts from the web? It looks like we could do this with a package like expo-font, but I don't understand why we would want to do this.
  3. ...
  4. ...
  5. I'm almost certain any fonts we keep in the app binary can be extracted through decompilation.
kueda commented 1 year ago

What's the benefit of loading fonts from the web?

To reduce the binary size, but primarily because it affects the kind of license we need to purchase if the font is proprietary. Some licenses explicitly disallow distribution in an app binary but do allow self-hosting on the web.

kueda commented 1 year ago

Closed in https://github.com/inaturalist/iNaturalistReactNative/pull/192

We didn't figure out a way to load fonts from the web so they'll need to be packaged with the app binary, and licensed as such.