Skip to content

Commit

Permalink
query_name: Examine all languages
Browse files Browse the repository at this point in the history
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
  • Loading branch information
Finii committed Jan 15, 2024
1 parent 23c0cbf commit 2f55e64
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions bin/scripts/name_parser/query_name
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ import fontforge

def get_sfnt_dict(font):
"""Extract SFNT table as nice dict"""
return { k: v for l, k, v in font.sfnt_names }
d = { }
for l, k, v in font.sfnt_names:
if k not in d:
d[k] = [ v ]
else:
d[k] += [ v ]
d = { k: v[0] if v and len(v) == 1 else tuple(v) for k, v in d.items() }
return d

###### Let's go!

Expand All @@ -38,13 +45,13 @@ for filename in sys.argv[1:]:
sfnt_full = sfnt.get('Fullname', None)
sfnt_fam = sfnt.get('Family', None)
sfnt_subfam = sfnt.get('SubFamily', None)
sfnt_pfam = sfnt.get('Preferred Family', '')
sfnt_psubfam = sfnt.get('Preferred Styles', '')
sfnt_psname = sfnt.get('PostScriptName', '')
sfnt_compat = sfnt.get('Compatible Full', '')
sfnt_cidff = sfnt.get('CID findfont Name', '')
sfnt_wfam = sfnt.get('WWS Family', '')
sfnt_wsubfam = sfnt.get('WWS Subfamily', '')
sfnt_pfam = sfnt.get('Preferred Family', '-')
sfnt_psubfam = sfnt.get('Preferred Styles', '-')
sfnt_psname = sfnt.get('PostScriptName', '-')
sfnt_compat = sfnt.get('Compatible Full', '-')
sfnt_cidff = sfnt.get('CID findfont Name', '-')
sfnt_wfam = sfnt.get('WWS Family', '-')
sfnt_wsubfam = sfnt.get('WWS Subfamily', '-')


if add_line:
Expand Down

0 comments on commit 2f55e64

Please sign in to comment.