Skip to content

fontlabapp.studios.font_audit.model

model

Font Audit calculations over one _records.Catalogue: the absorbed reports' rules.

What: the Font Overview cards, the Label Statistics groups, the Glyph Table CSV rows and file format, the Unicode Coverage blocks, the Empty Glyphs scan and the shared texts of each report, kept exactly as in the Scriptmix originals (thresholds, defaults, order, formats). Overview "Empty" means no contours and no components on the current master; Empty Glyphs counts contours only, on every master (a missing layer is empty): the originals differ and so do these helpers. Pure and Qt-free. Used by fontlabapp.studios.font_audit (session and tabs).

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
CSV_DEFAULT attribute
CSV_FILTER attribute
CSV_HINT attribute
CSV_TITLE attribute
HIDE_SPACES attribute
HUES attribute (shared captured text)
METRIC_COLUMNS attribute
OVERVIEW_STATUS attribute
SPACE_CATEGORIES attribute
SPACE_NAMES attribute
assigned function (start: int, end: int) -> int Number of assigned characters (not Cn) in a range.
block_names function (codes: dict[int, str], start: int, end: int) -> list[str] Glyphs of the block, in the first-glyph-wins code order the original uses.
coverage function (codes: Iterable[int], show_all: bool=False) -> tuple[list[tuple], list[int]] <code>&#91;(start, end, block, covered, assigned)&#93;</code> for touched (or all) blocks, and the codes outside.
coverage_status function (rows: Sequence, outside: Sequence) -> str
coverage_subtitle function (codes: dict, rows: Sequence[tuple]) -> str
empty_subtitle function (rows: Sequence[tuple[str, list[str]]], masters: Sequence[str]) -> str
font_codes function (cat: Catalogue) -> dict[int, str] {code point: glyph name} of the font (first glyph wins).
font_labels function (cat: Catalogue) -> list[tuple[str, int]] <code>&#91;(glyph name, mark)&#93;</code><code> in font order (every glyph, as </code><code>CurrentFont().glyphs</code>).
is_whitespace function (name: str, codes: Iterable[int]) -> bool Recognise intentional empty glyphs by Unicode category and conventional names.
label_subtitle function (labels: Sequence[tuple[str, int]], marks: Sequence, suffixes: Sequence) -> str
mark_label function (mark: int) -> str Describe FontLab colour marks using the original hue buckets.
mark_rgb function (mark: int, lightness: int=150) -> tuple[str, int, int, int] | None The original swatch colour: <code>(&quot;hsl&quot;, hue, 200, lightness)</code><code> or </code><code>(&quot;rgb&quot;, g, g, g)</code>.
metric_text function (value: Any) -> str Overview metric cells: <code>{value:g}</code>.
overview_cards function (cat: Catalogue) -> dict[str, int] The eight Font Overview cards, in their original order.
percent function (covered: int, total: int) -> str The original progress-bar text.
plural function (count: int) -> str
preview_text function (names: Iterable[str]) -> str TMetrics text for <code>names</code><code>: </code><code>/a/b</code>; empty for none.
scan_empty function (cat: Catalogue, skip_whitespace: bool) -> list[tuple[str, list[str]]] <code>&#91;(glyph name, &#91;master, ...&#93; without contours)&#93;</code> in font order.
statistics function (labels: Iterable[tuple[str, int]]) -> tuple[list, list] <code>(&#91;(mark, &#91;names&#93;)&#93;, &#91;(suffix, &#91;names&#93;)&#93;)</code> sorted by count, largest first.
subtitle function (cat: Catalogue) -> str
suffix_of function (name: str) -> str '.ss01.sc' for 'a.ss01.sc'; '' for 'a' and '.notdef'.
table function (cat: Catalogue, names: Iterable[str]) -> tuple[list[str], list[list[Any]]] Header and rows of Glyph Table CSV for <code>names</code>; unknown glyphs are skipped.
table_subtitle function (cat: Catalogue, rows: Sequence) -> str
to_csv function (header: Sequence, rows: Iterable[Sequence]) -> str Encode report rows with standard CSV quoting and LF line endings.
write_csv function (path: Any, header: Sequence, rows: Iterable[Sequence]) -> int Write the CSV (UTF-8 with BOM so spreadsheets detect it); return the byte size.