Skip to content

Commit

Permalink
Serialize old-school kern table
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Apr 19, 2024
1 parent e667af6 commit 75e2518
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/diffenator2/jfont.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ def serialise_cmap(obj):
return {f"0x{hex(k)[2:].zfill(4).upper()}": v for k, v in obj.getBestCmap().items()}


def serialise_kern(obj):
return [
{"/".join(k): v for k, v in table.kernTable.items()} for table in obj.kernTables
]


def bit_list(bits, cast_list):
res = []
for bit, name in cast_list:
Expand Down Expand Up @@ -205,7 +211,10 @@ def _TTJ(obj, root=None,depth=1):

elif isinstance(obj, table__c_m_a_p):
return serialise_cmap(obj)


elif isinstance(obj, table__k_e_r_n):
return serialise_kern(obj)

elif isinstance(obj, Glyph):
return serialise_glyph(obj, root)

Expand Down

0 comments on commit 75e2518

Please sign in to comment.