fontlabapp.fontui.teaching_writers.font_info_snapshot
font_info_snapshot
What: Save and compare current-master naming and credit settings as JSON. How: Capture package naming, version, PostScript and credit text. Export a versioned snapshot. Load a previous snapshot and compare it against fresh current data. Why: Explicit files make name-setting changes visible across font revisions. Usage: Refresh and Export New to save. Enter a saved snapshot's absolute path and Compare Saved to inspect each changed field. No settings are applied. Benefit: Reuse the saved JSON in this tool or a font build check. Only the current master is read. Comparisons across masters are refused. This naming snapshot is not a whole-font backup. UTF-8 BOM and CR line endings are detected from input bytes; only actual conversions are reported.
Setup: FontLab 9, Python 3.11, Fly and App draft_signals/qt_properties. Modeless panel; font data, selection and application preferences stay unchanged.
Independent rewrite of the Qt settingseditor example idea (Qt/Riverbank Computing; Nokia Corporation). Based on the author's own FontLab sample, Apache-2.0. Historical source: rescued/part3/pyqt-official-ports/ports/tools/pyqt-official/settingseditor-9e41e71c41b116a8.py SHA256: 1a35d9d5b3989ba7728ce129fea1bcc98cce4b221f59cf8916788ffe0ab53475 Historical source: rescued/part2/ports/tools/pyqt-official/settingseditor-9e41e71c41b116a8.py SHA256: 1433012d1ff11a45c6414df8c625c99fc9e17cd93a91d7bc4e518ebfac5dd890
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
Capture |
attribute | ||
FIELDS |
attribute | ||
HELP |
attribute | ||
TITLE |
attribute | ||
capture_info |
function | (native: Any=None) -> Capture |
Read naming text and master twice from one fenced workspace package. |
checked |
function | (text: str) -> str |
Refuse text that the Qt bridge can change or UTF-8 cannot encode. |
compare_info |
function | (saved: Capture, current: Capture) -> str |
Compare naming text only when both snapshots identify the same master. |
export_new |
function | (filename: str, text: str) -> None |
Write exact UTF-8 to a new absolute file; refuse overwrite and symlinks. |
main |
function | () -> None |
Use FontLab's main window and Fly; never construct an application. |
read_snapshot |
function | (filename: str) -> tuple[Capture, tuple[str, ...]] |
Read schema 2 as data and report only detected byte conversions. |
show |
function | (qt: Any, parent: Any, *, embedded: bool=False) -> Any |
Open a retained modeless panel; disconnect owned slots before deletion. |
snapshot_json |
function | (captured: Capture) -> str |
Serialize current-master naming and credits with schema version 2. |
unique_object |
function | (pairs: list[tuple[str, Any]]) -> dict[str, Any] |
Refuse duplicate JSON keys rather than silently losing a setting. |