formatting

This commit is contained in:
jrkb 2025-05-13 16:08:53 +02:00
parent a681245093
commit ff85c93551
5 changed files with 641 additions and 549 deletions

View file

@ -150,7 +150,6 @@ class ABC3D_glyph_properties(bpy.types.PropertyGroup):
class ABC3D_text_properties(bpy.types.PropertyGroup):
def font_items_callback(self, context):
items = []
for f in Font.get_loaded_fonts_and_faces():
@ -291,7 +290,7 @@ class ABC3D_data(bpy.types.PropertyGroup):
)
export_dir: bpy.props.StringProperty(
name="Export Directory",
description=f"The directory in which we will export fonts.\nIf it is blank, we will export to the addon assets path.\nThis is where the fonts are installed.",
description="The directory in which we will export fonts.\nIf it is blank, we will export to the addon assets path.\nThis is where the fonts are installed.",
subtype="DIR_PATH",
)
@ -381,7 +380,7 @@ class ABC3D_PT_FontList(bpy.types.Panel):
box.row().label(text=f"Face Name: {face_name}")
n = 16
n_rows = int(len(available_glyphs) / n)
box.row().label(text=f"Glyphs:")
box.row().label(text="Glyphs:")
subbox = box.box()
for i in range(0, n_rows + 1):
text = "".join(
@ -397,7 +396,7 @@ class ABC3D_PT_FontList(bpy.types.Panel):
row.alignment = "CENTER"
row.label(text=text)
n_rows = int(len(loaded_glyphs) / n)
box.row().label(text=f"Loaded/Used Glyphs:")
box.row().label(text="Loaded/Used Glyphs:")
subbox = box.box()
for i in range(0, n_rows + 1):
text = "".join(
@ -595,7 +594,9 @@ class ABC3D_PT_FontCreation(bpy.types.Panel):
layout.row().operator(
f"{__name__}.create_font_from_objects", text="Create/Extend Font"
)
layout.row().operator(f"{__name__}.save_font_to_file", text="Export Font To File")
layout.row().operator(
f"{__name__}.save_font_to_file", text="Export Font To File"
)
box = layout.box()
box.label(text="metrics")
box.row().operator(
@ -762,9 +763,9 @@ class ABC3D_OT_InstallFont(bpy.types.Operator):
title=f"{__name__} Warning",
icon="ERROR",
message=[
f"Could not install font.",
"Could not install font.",
f"We believe the font path ({font_path}) does not exist.",
f"If this is an error, please let us know.",
"If this is an error, please let us know.",
],
)
return {"CANCELLED"}
@ -1200,7 +1201,7 @@ class ABC3D_OT_SaveFontToFile(bpy.types.Operator):
n = 16
n_rows = int(len(loaded_glyphs) / n)
box = layout.box()
box.row().label(text=f"Glyphs to be exported:")
box.row().label(text="Glyphs to be exported:")
subbox = box.box()
for i in range(0, n_rows + 1):
text = "".join(
@ -1311,7 +1312,7 @@ class ABC3D_OT_SaveFontToFile(bpy.types.Operator):
butils.remove_faces_from_metrics(obj)
bpy.app.timers.register(lambda: remove_faces(), first_interval=2)
self.report({"INFO"}, f"did it")
self.report({"INFO"}, "did it")
return {"FINISHED"}
@ -1365,9 +1366,7 @@ class ABC3D_OT_CreateFontFromObjects(bpy.types.Operator):
row = layout.row()
row.prop(self, "autodetect_names")
first_object_name = context.selected_objects[-1].name
self.font_name, self.face_name = (
self.do_autodetect_names(first_object_name)
)
self.font_name, self.face_name = self.do_autodetect_names(first_object_name)
if self.autodetect_names:
scale_y = 0.5
row = layout.row()
@ -1663,7 +1662,7 @@ def on_depsgraph_update(scene, depsgraph):
def later():
if (
not "lock_depsgraph_update_ntimes" in scene.abc3d_data
"lock_depsgraph_update_ntimes" not in scene.abc3d_data
or scene.abc3d_data["lock_depsgraph_update_ntimes"] <= 0
):
butils.set_text_on_curve(