metrics loading

filter metrics when loading and add them for a glyph that has them as a
child
This commit is contained in:
themancalledjakob 2024-08-08 11:21:34 +02:00
parent 174754831d
commit 65605aa2c0

View file

@ -400,7 +400,10 @@ def load_font_from_filepath(filepath):
# must be new # must be new
if ("glyph" in o.keys() if ("glyph" in o.keys()
and "face_name" in o.keys() and "face_name" in o.keys()
and "font_name" in o.keys()): and "font_name" in o.keys()
and not ("type" in o.keys() and o["type"] == "metrics")
and not is_metrics_object(o)
):
glyph_id = o["glyph"] glyph_id = o["glyph"]
font_name = o["font_name"] font_name = o["font_name"]
face_name = o["face_name"] face_name = o["face_name"]
@ -412,6 +415,10 @@ def load_font_from_filepath(filepath):
face_name, face_name,
glyph_id, glyph_id,
glyph_obj) glyph_obj)
for c in o.children:
if is_metrics_object(c):
add_metrics_obj_from_bound_box(glyph_obj,
bound_box_as_array(c.bound_box))
if glyph_obj != o: if glyph_obj != o:
remove_list.append(o) remove_list.append(o)