Skip to content

fontlabapp.features.identity_tools.nastaliq_connections.editor

editor

Edit Qalmi Nastaliq connections and save reverse substitutions in the font.

What: Choose a left medial/final glyph, a right medial/initial family and its numbered alternate. Preview entry/exit alignment on any master. Previous and Next step through actual alternates, including s/sd forms. How: Save connection writes a named lookup inside rlig through Fontport's exact-source writer. A JSON comment in that lookup stores the choices, so reopening the tool restores them. Each save is recorded as one Undo step. Existing rlig statements and all other feature blocks stay in place. Earlier unmanaged reverse rules are listed as a warning because they can run first. Saved pairs with missing glyphs appear as named kept rows and produce no rules; their records stay in the font until Drop stale pairs on Save is ticked. Why: FontLab's Features panel edits source text. This panel adds Qalmi pair selection, aligned outlines and grouped reverse contextual substitutions. Use: Open a Qalmi-named font. Choose a pair and alternate, inspect the preview, then Save connection. Compile and test the feature in FontLab's Features panel. Reload reads saved choices. Closing without Save does not change that pair. Benefit: Review and persist connections without editing feature syntax.

Credit: Independent behaviour-only rewrite of Simon Cozens, GlyphsScripts/Nastaliq Connection Editor.py, MIT, copyright 2017. Repository: https://github.com/simoncozens/GlyphsScripts . No source code copied.

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
Choices attribute
DATA attribute
END attribute
FORM attribute
KEY attribute
LOOKUP attribute
START attribute
TITLE attribute
connection_block function (choices: Choices, names: set[str]) -> str Compile valid pairs only; retain stale choices as JSON without rules.
inventory function (names: list[str]) -> tuple[list[str], list[str], dict[str, list[str]]] Return left glyphs, right families and actual numbered variants.
main function () -> Any Open or replace the connection editor through the shared registry.
merge_feature function (blocks: dict[str, Any], snippet: str) -> dict[str, Any] Replace our region, or insert before a single rlig closing statement.
name_order function (name: str) -> tuple[str, int, str] Sort by family and numeric suffix, with the source's paired rasm order.
pair_problem function (left: str, stem: str, replacement: str, names: set[str]) -> str Explain an invalid pair without losing its saved record.
panel_type function () -> type Create the owned modeless editor and the shared attachment drawing.
partition_choices function (choices: Choices, names: set[str]) -> tuple[Choices, dict[tuple[str, str], str]] Separate usable choices from stale records; the caller keeps both.
save_pair function (package: Any, expected: dict[str, Any], choices: Choices, names: set[str]) -> dict[str, int] Use Fontport's source-bound writer; expose partial failures with Undo advice.
saved_choices function (code: str) -> Choices Read our exact managed comment; refuse ambiguous or malformed records.
unmanaged_rule_bases function (blocks: dict[str, Any]) -> list[str] Find earlier bare reverse rules outside the tool's managed region.