crtxdmp.

A collection of ideas, snippets and other things.


Add fonts to react-native app

  1. Store ttf fonts in /assets/fonts folder
  2. cd /assets/fonts
  3. rename fonts to postscript name via
    for file in "$arg"*.ttf; do
        postscriptname=$(fc-scan --format "%{postscriptname}\n" $file);
        echo "$postscriptname.ttf\n"
        mv "$file" "$postscriptname.ttf";
    done
  4. npx react-native link
  5. add fontFamily to your css e.g. fontFamily: "Kanit-Bold"
  6. rebuild app

— Jul 8, 2021