from pathlib import Path
from fontTools.ttLib import TTFont
import json
p=Path(__file__).parent;f=TTFont(p/'coverage-fixture.ttf');m=f.getBestCmap();r=[{'character':x,'codepoint':f'U+{ord(x):04X}','present':ord(x) in m} for x in (p/'targets.txt').read_text(encoding='utf-8').strip()]
assert [x['present'] for x in r]==[True,True,False]
print(json.dumps(r,ensure_ascii=True,indent=2))
