fix shadowing variable

This commit is contained in:
jrkb 2025-05-18 17:22:48 +02:00
parent d88c0c50cd
commit 6943a9189c

View file

@ -511,17 +511,17 @@ def load_font_from_filepath(filepath, glyphs="", font_name="", face_name=""):
modified_font_faces.append({"font_name": font_name, "face_name": face_name})
for mff in modified_font_faces:
glyphs = []
mff_glyphs = []
face = Font.fonts[mff["font_name"]].faces[mff["face_name"]]
# iterate glyphs
for g in face.glyphs:
# iterate alternates
for glyph in face.glyphs[g]:
glyphs.append(get_original(glyph))
if len(glyphs) > 0:
add_default_metrics_to_objects(glyphs)
mff_glyphs.append(get_original(glyph))
if len(mff_glyphs) > 0:
add_default_metrics_to_objects(mff_glyphs)
# calculate unit factor
h = get_glyph_height(glyphs[0])
h = get_glyph_height(mff_glyphs[0])
if h != 0:
face.unit_factor = 1 / h