Debugging Python Scripts

Use the Scripting panel's debugger to inspect a script as it runs. Breakpoints and stepping help locate a wrong target or value before the script reaches later operations. Run development scripts on a source copy when they modify font data.

Pause at a Breakpoint

Open the script in the Scripting panel and click a line number to set a breakpoint. Start the current editor contents with the debugger. Normal Run ignores breakpoints, so choose the debugging route when you want execution to pause.

At a pause, inspect the stack frames and variables to check which function is running, the objects it is using, and the values passed to it. An uncaught exception retains its stack for inspection.

Step through the Operation

Use Step Over to execute the next statement without following a called function, Step Into to enter a call, and Step Out to return from the current function. Continue resumes until the next stop. Check the selected font, glyph, and layer before continuing through a modifying operation.

Pause and Stop requests wait for a native call to return. A long FontLab operation may therefore finish before control returns to the debugger. Stopping execution does not undo font edits already made; inspect the font and use its Undo history or restore the source copy as appropriate.

Keep Editing and Display Separate

The Scripting panel's word-wrap control fits long lines to the editor width without inserting line breaks into the script. Turn it off when horizontal scrolling makes code easier to inspect. Saving, running, and debugging are separate operations: confirm the editor contents you intend to execute.