build.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. for font in $(ls fonts/web/static/*.ttf)
  44. do
  45. python scripts/touchup_for_web.py $font;
  46. done
  47. # Make ChromeOS
  48. mkdir -p fonts/chromeos
  49. CHROMEOS_VF_PATH=fonts/chromeos/Roboto[ital,wdth,wght].ttf
  50. subset.py $HINTED_VF_PATH $CHROMEOS_VF_PATH
  51. python scripts/touchup_for_cros.py $CHROMEOS_VF_PATH
  52. python scripts/instantiate_statics.py $CHROMEOS_VF_PATH fonts/chromeos/static
  53. for font in $(ls fonts/chromeos/static/*.ttf)
  54. do
  55. python scripts/touchup_for_cros.py $font;
  56. done