fontlabapp.fonts.identity_tools.encoding_order.paste
paste
Insert pasted names into the current font's order and save a FontLab encoding.
Select a glyph, run the tool, and paste space-separated glyph names. Preview moves known names before the selected glyph, keeping pasted order and removing repetitions. Unknown names are listed. The insertion position stays defined even when the selected glyph is among the pasted names.
Save a new .enc file anywhere, then use File > Import > Encoding. Choose the encoding in the Font window; use the encoding chooser's Refresh button as needed. This produces an ordered Encoding view; it does not change the font's stored glyph indices. FontLab's File > Export > Encoding saves a visible order; this tool adds insertion by pasted names. Existing files are kept. No font edit or Undo step is made. The preview shows up to 200 rows; the file contains every supported glyph. Non-ASCII or unsafe glyph names get named kept rows and stay out of the file. Why: Glyphs glyphOrder has no bound FontLab glyph-reorder API. An encoding provides a persistent order that FontLab can import without changing glyph indices. Benefit: Move a pasted sequence in one action and reuse its order in FontLab.
Independent behaviour rewrite after Alex Slobzheninov, Glyphs-Scripts, Font Info/glyphOrder - Paste.py, Apache-2.0. Repository: https://github.com/slobzheninov/Glyphs-Scripts . No upstream code, private identifiers or comments are used.
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_names |
function | () -> tuple[str, ...] |
Read current font order with a fresh budget, without requiring selection. |
capture_order |
function | () -> tuple[tuple[str, ...], str] |
Read font order and the first selected glyph without writing selection. |
encoding_rows |
function | (names: tuple[str, ...]) -> tuple[tuple[str, ...], tuple[str, ...]] |
Keep unsupported names out of the encoding and report each by name. |
insert_names |
function | (names: tuple[str, ...], text: str, before: str) -> tuple[tuple[str, ...], tuple[str, ...]] |
Move known tokens once; retain all other glyphs and report unknown tokens. |
main |
function | () -> Any |
Open the original standalone encoding panel. |
panel_type |
function | () -> type |
Build the source-bound order panel for embedding in the studio. |
save_encoding |
function | (path: Path, names: tuple[str, ...]) -> tuple[str, ...] |
Save supported rows in a new file; return every named kept row. |