touchup_for_android.py 865 B

1234567891011121314151617181920212223242526272829303132
  1. import sys
  2. from fontTools.ttLib import TTFont
  3. from nototools import font_data
  4. from scripts import *
  5. def main(font_path):
  6. font = TTFont(font_path, recalcBBoxes=False)
  7. # turn off round-to-grid flags in certain problem components
  8. # https://github.com/google/roboto/issues/153
  9. glyph_set = font.getGlyphSet()
  10. ellipsis = glyph_set['ellipsis']._glyph
  11. for component in ellipsis.components:
  12. component.flags &= ~(1 << 2)
  13. font_data.delete_from_cmap(font, [
  14. 0x20E3, # COMBINING ENCLOSING KEYCAP
  15. 0x2191, # UPWARDS ARROW
  16. 0x2193, # DOWNWARDS ARROW
  17. ])
  18. # Update vertical metrics to match v2.136
  19. update_attribs(
  20. font,
  21. **android_and_cros_vert_metrics
  22. )
  23. update_psname_and_fullname(font, include_year=True)
  24. update_font_version(font)
  25. font.save(font_path)
  26. main(sys.argv[1])