Skip to content

fontlabapp.glyphs.copies

copies

Shared kernel of the scripts that make new glyphs from copies of existing ones.

What: Small Caps From Capitals, Superior & Inferior Figures and Tabular Figure Copies plan one new glyph per selected source glyph and copy its contours, transformed, into every master. This module holds the parts that were byte-identical in the three scripts:

  • survey_with plans one Row per selected name with the script's naming rule. It lists and skips a repeated target, a missing source, a target that exists, a source layer that cannot be copied (source_problem) and, without the user's consent, a target that can make FontLab rebuild automatic glyphs (Row.rebuild).
  • create makes the planned glyphs through fontlabapp.glyphs.creation.create_glyphs: each glyph with its master widths, then all contours in one Undo step, then a read-back.
  • panel_type() returns CopiesPanel, the shared panel of the three scripts (a fontlabapp.contours.selection.panel.model panel with a source table and the rebuild consent tick).

How: a job is (new name, [(master, contours, advance)]); the script's prepare builds it with fontlabapp.contours.copy.copy_contours. Undo: glyph_creation.UNDO_TEXT.

This module imports only the standard library and stdlib-only App modules at load time; PythonQt loads in panel_type() and fontlab in create. Offline tests do not prove native Undo/Redo.

How to use (a script)::

import fly.ap.glyphs.copies as glyph_copies

rows = glyph_copies.survey_with(package, names, naming, facts, allow_rebuild)
result = glyph_copies.create(package, jobs, "Small Caps", facts, allow_rebuild=True)

Classes

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
Job attribute
Naming attribute
create function (package: Any, jobs: Sequence[Job], title: str, facts: history.AutoFacts, *, allow_rebuild: bool=False) -> di… Create every planned glyph, then add all contours as ONE Undo step.
half_up function (value: float) -> int Round half up (250.5 -> 251), as the other metrics scripts do.
panel_type function () -> type Return the <code>CopiesPanel</code><code> base class (a PythonQt </code><code>QDialog</code>).
source_problem function (layer: Any) -> str Return why a source master layer cannot be copied, or "".
survey_with function (package: Any, names: Sequence[str], naming: Naming, facts: history.AutoFacts, allow_rebuild: bool=False) -> … Plan one new glyph per selected name.