Skip to content

fontlabapp.fontui.teaching_writers.layer_metric_comparison

layer_metric_comparison

What: Compare selected glyph-layer measurements with one reference cell. How: Read complete equal passes of advances, outline bounds and sidebearings. Calculate signed differences or percentages. Zero denominators stay undefined; empty outlines keep unavailable dimensions and margins. Never substitute one. Why: Relative measurements expose proportion and spacing differences directly. Usage: Select layers in a Font or Glyph window. Choose Advance, Width, Height, Left or Right. Enter a reference glyph and layer, or leave both blank to use the first selected occurrence. Choose Difference or Percent. Copy the table. Benefit: Compare actual selected layers without switching the active master. The table is tab-separated text. Selection controls the compared layers; this tool does not add unselected masters, scan named glyph lists or provide an independent selected-node part/whole calculator. View > Metrics Table edits metrics; this comparison reports relative values.

Independent behaviour-only rewrite of the metric-comparison idea from Stats.py. Credit: Vassil Kateliev and Karandash Type Foundry; kateliev/TypeRig, MPL-2.0. No TypeRig code, comments, icons or resources are included. Setup: FontLab 9, Python 3.11, Fly and App>=0.2.150.dev0.

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 dict[int, tuple[str, ...]]
FIELDS attribute
HELP attribute
MetricRow attribute
TITLE attribute
build_output function (fields: tuple[str, ...]) -> str Compare every occurrence to an explicit reference; preserve real zeros.
capture_metrics function () -> tuple[MetricRow, ...] Use ordered selected-layer captures with equal scalar reads and context.
checked function (text: str) -> str Refuse characters that the Qt bridge or proof syntax can change. (shared captured text)
main function () -> None Open inside FontLab's existing application and main window.
read_rows function (selected: Any, deadline: float) -> tuple[MetricRow, ...] Read scalar geometry only; retain empty outlines as unavailable values.
show function (qt: Any, parent: Any, *, embedded: bool=False) -> Any Open an owned modeless panel; drain callbacks before deletion.