build.sh 2.3 KB

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