Automation Hooks and Direct Data Access
Hooks provide shared setup for scripts. The Source panel provides direct access to serialized glyph data. Use each for its specific scope rather than treating it as a substitute for the application's entire object model.
Startup and Init Hooks
FontLab uses two specially named scripts with different locations and execution points:
| File | Location and execution point |
|---|---|
startupScript.py |
The fixed FontLab 9 application-data directory; runs when the Python context is initialized or cleared. |
initScript.py |
Configured user data folder (see The User Data Folder and Customizable Data Files); runs during application initialization. |
The default startupScript.py directory is ~/Library/Application Support/FontLab/FontLab 9/ on macOS and %LOCALAPPDATA%\FontLab\FontLab 9\ on Windows. Relocating the user data folder does not relocate this startup file. With Clear Python Context enabled, each Scripting-panel run clears the context and runs the startup script again. With it disabled, subsequent runs reuse the context instead.

The Scripting menu separates clearing the context before a run from clearing it immediately.
Use startupScript.py for imports or search-path adjustments that scripts need. Keep it safe to execute whenever the context is reset; an operation that adds data to an open font is not appropriate as incidental setup.
Use initScript.py for deliberate initialization, such as connecting supported event handlers or registering an extension. Avoid assuming that a particular font or Glyph window is already open when it runs.
The interface-customization possibility deferred from Windows, Panels, and Workspaces includes Qt-based UI font or palette changes, an advanced, unofficial route. They can depend on implementation details and are separate from the supported theme and workspace controls. Keep a recoverable copy of the hook before changing startup behavior.
Document hook dependencies with a shared script library. A script that works only because of an undocumented local startup import is difficult to hand off.
The Source Panel
Open Window > Panels > Source to inspect VFJ-compatible data for the active object. This complements the Python API and shows how the element/layer model from The Element Model and Layers and Masters is represented in the native JSON format from Understanding Font Formats. The scope controls select Glyph, Layer, or Element.
Glyph scope includes the glyph's layers and elements. Layer scope narrows the view to the active layer. Element scope shows the current element. Confirm that scope before pasting a fragment from another object. The editor omits the outer JSON braces: retain the displayed fragment form rather than wrapping it as a complete VFJ file.

Glyph scope shows a JSON fragment with glyph identity and layer data. The editor omits the outer braces of a complete JSON object.
To make a targeted edit:
- Save the native source and copy the original fragment if needed.
- Select the correct glyph, layer, or element scope.
- Change only the intended data while retaining the displayed structure.
- Use Apply (Ctrl+Enter, as shown by its control) and read any validation message.
- Inspect the resulting object and its dependent behavior.
Revert discards unapplied editor changes. It is different from undoing a change already applied to the glyph. Copy transfers the displayed source for inspection or deliberate reuse.
Valid JSON is not automatically valid design intent. A structurally accepted edit can still change metrics, references, or a construction in a way you did not intend. Check the font result rather than treating parser acceptance as complete verification.
The panel's update timing follows the relevant live-preview behavior. Avoid editing a stale fragment after switching the current object without checking the displayed identity.
This is a glyph-level data surface, not a general editor for all font-wide classes, kerning, or Font Info. Use the appropriate font-level interface or API, or export a VFJ source to inspect the complete font-level data. A displayed fragment is not a complete standalone font file.