build.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. set -e
  2. mkdir -p fonts
  3. #Make unhinted
  4. mkdir -p fonts/unhinted
  5. UNHINTED_VF_PATH=fonts/unhinted/Roboto[ital,wdth,wght].ttf
  6. fontmake -m sources/Roboto.designspace -o variable --output-path $UNHINTED_VF_PATH
  7. python scripts/drop_mvar.py $UNHINTED_VF_PATH
  8. python scripts/gen_stat.py $UNHINTED_VF_PATH
  9. python scripts/instantiate_statics.py $UNHINTED_VF_PATH fonts/unhinted/static
  10. # Make Android
  11. mkdir -p fonts/android
  12. ANDROID_VF_PATH=fonts/android/Roboto[ital,wdth,wght].ttf
  13. subset.py $UNHINTED_VF_PATH $ANDROID_VF_PATH
  14. python scripts/touchup_for_android.py $ANDROID_VF_PATH
  15. python scripts/instantiate_statics.py $ANDROID_VF_PATH fonts/android/static
  16. for font in $(ls fonts/android/static/*.ttf)
  17. do
  18. python scripts/touchup_for_android.py $font;
  19. done
  20. # Make hinted
  21. mkdir -p fonts/hinted
  22. HINTED_VF_PATH=fonts/hinted/Roboto[ital,wdth,wght].ttf
  23. # Transfer Hints and compile them
  24. cp $UNHINTED_VF_PATH $HINTED_VF_PATH
  25. python -m vttLib mergefile sources/vtt-hinting.ttx $HINTED_VF_PATH
  26. python -m vttLib compile $HINTED_VF_PATH $HINTED_VF_PATH.fix --ship
  27. mv $HINTED_VF_PATH.fix $HINTED_VF_PATH
  28. python scripts/touchup_for_web.py $HINTED_VF_PATH
  29. python scripts/instantiate_statics.py $HINTED_VF_PATH fonts/hinted/static
  30. for font in $(ls fonts/web/hinted/*.ttf)
  31. do
  32. python scripts/touchup_for_web.py $font;
  33. done
  34. # Make web
  35. mkdir -p fonts/web
  36. WEB_VF_PATH=fonts/web/Roboto[ital,wdth,wght].ttf
  37. python scripts/subset_for_web.py $HINTED_VF_PATH $WEB_VF_PATH
  38. python scripts/touchup_for_web.py $WEB_VF_PATH
  39. # Split fonts can be removed once all browsers support slnt and ital axes properly
  40. mkdir -p fonts/web/split
  41. python scripts/split_slnt_vf.py $WEB_VF_PATH fonts/web/split
  42. python scripts/instantiate_statics.py $WEB_VF_PATH fonts/web/static
  43. python scripts/instantiate_condensed.py \
  44. fonts/web/split/Roboto[wdth,wght].ttf \
  45. fonts/web/split/Roboto-Italic[wdth,wght].ttf \
  46. fonts/web/condensed
  47. for font in $(ls fonts/web/static/*.ttf)
  48. do
  49. python scripts/touchup_for_web.py $font;
  50. done
  51. # Make ChromeOS
  52. mkdir -p fonts/chromeos
  53. CHROMEOS_VF_PATH=fonts/chromeos/Roboto[ital,wdth,wght].ttf
  54. subset.py $HINTED_VF_PATH $CHROMEOS_VF_PATH
  55. python scripts/touchup_for_cros.py $CHROMEOS_VF_PATH
  56. python scripts/instantiate_statics.py $CHROMEOS_VF_PATH fonts/chromeos/static
  57. for font in $(ls fonts/chromeos/static/*.ttf)
  58. do
  59. python scripts/touchup_for_cros.py $font;
  60. done