from pathlib import Path
from fontTools.ttLib import TTFont
import json
p=Path(__file__).parent;x=json.loads((p/'icon-contract.json').read_text(encoding='utf-8'));f=TTFont(p/x['src']);g=f.getBestCmap().get(int(x['codepoint'][2:],16));assert g==x['glyph']
assert 'geo-icon.ttf' in (p/'specimen.html').read_text(encoding='utf-8')
print(json.dumps({'resource_exists':True,'family':f['name'].getDebugName(1),'codepoint':x['codepoint'],'glyph':g,'browser_load':'not_measured'},indent=2))
