Home/ Reference/ Recipes

Verify the font before converting to curves

Converting to curves is irreversible, so the order is fixed: set the font → wait 0.3 s → read it back → ConvertToCurves. If the check fails, skip the shape. Never co

Scenario

Verify the font before converting to curves

Notes

Converting to curves is irreversible, so the order is fixed: set the font → wait 0.3 s → read it back → ConvertToCurves. If the check fails, skip the shape. Never convert the wrong font.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
import time

shape = app.ActiveSelectionRange(1)
TARGET = "Source Han Sans Bold"

ok = False
for _ in range(3):
    shape.Text.Story.Characters.All.Font = TARGET
    time.sleep(0.3)
    if shape.Text.Story.Characters.All.Font == TARGET:
        ok = True
        break

if ok:
    shape.ConvertToCurves()          # only convert once the font is confirmed
    print("Converted to curves")
else:
    print("Font did not take; aborting the conversion so a wrong font is not baked in")

About this section: Recipes

Recipes — copy-paste ready workflows.

Other entries in this section