Merge pull request #418 from googlefonts/colrv1-allow-embedding
colrv1_postproc.py: set OS/2.fsType=0 to remove font embedding restrictionspull/411/merge
commit
934a5706f1
|
@ -283,6 +283,14 @@ def _add_fallback_subs_for_unknown_flags(colr_font):
|
|||
font_data.delete_from_cmap(colr_font, [UNKNOWN_FLAG_PUA])
|
||||
|
||||
|
||||
def _set_no_font_embedding_restrictions(colr_font):
|
||||
# The CBDT/CBLC NotoColorEmoji has OS/2.fsType = 0 (i.e. no embedding restrictions)
|
||||
# so the COLRv1 variant must also have no such restrictions.
|
||||
# https://github.com/notofonts/noto-fonts/issues/2408
|
||||
# https://github.com/google/fonts/issues/5729
|
||||
colr_font["OS/2"].fsType = 0
|
||||
|
||||
|
||||
def _font(path, check_fn, check_fail_str):
|
||||
assert path.is_file(), path
|
||||
font = ttLib.TTFont(path)
|
||||
|
@ -314,6 +322,8 @@ def main(_):
|
|||
|
||||
_add_fallback_subs_for_unknown_flags(colr_font)
|
||||
|
||||
_set_no_font_embedding_restrictions(colr_font)
|
||||
|
||||
print("Writing", colr_file)
|
||||
colr_font.save(colr_file)
|
||||
|
||||
|
|
Loading…
Reference in New Issue