add custom properties to metrics
This commit is contained in:
themancalledjakob 2024-08-08 11:20:20 +02:00
parent e5f2fc1fd9
commit 174754831d

View file

@ -659,6 +659,10 @@ def set_text_on_curve(text_properties):
def add_metrics_obj_from_bound_box(glyph, bound_box=None): def add_metrics_obj_from_bound_box(glyph, bound_box=None):
mesh = bpy.data.meshes.new(f"{glyph.name}_metrics") # add the new mesh mesh = bpy.data.meshes.new(f"{glyph.name}_metrics") # add the new mesh
obj = bpy.data.objects.new(mesh.name, mesh) obj = bpy.data.objects.new(mesh.name, mesh)
obj["font_name"] = glyph["font_name"]
obj["face_name"] = glyph["face_name"]
obj["glyph"] = glyph["glyph"]
obj["type"] = "metrics"
col = glyph.users_collection[0] col = glyph.users_collection[0]
col.objects.link(obj) col.objects.link(obj)
# bpy.context.view_layer.objects.active = obj # bpy.context.view_layer.objects.active = obj