diff --git a/butils.py b/butils.py index 3a5f5d9..96d6ced 100644 --- a/butils.py +++ b/butils.py @@ -400,7 +400,10 @@ def load_font_from_filepath(filepath): # must be new if ("glyph" 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"] font_name = o["font_name"] face_name = o["face_name"] @@ -412,6 +415,10 @@ def load_font_from_filepath(filepath): face_name, glyph_id, 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: remove_list.append(o)