fontlabapp.studios.kerning_batch.punctuation
punctuation
Kerning Batch Punctuation tab: Scriptmix Unbundle Punctuation Kerning.
What: turn inherited (class) values involving the selected glyphs into
explicit glyph-pair exceptions on the current master (default) or all
masters. Class definitions, class pairs and every existing explicit glyph
pair (zero included) stay. "Unicode punctuation only" (on by default)
keeps glyphs outside the Unicode P* categories; an unencoded alternate uses
its base-name glyph's code points (read from the Fontport font, never
fgGlyph). An ambiguous partner keeps only that pair; a master with invalid
class members is named and kept; invalid numeric data on any master keeps the
whole font (the writer validates numeric history font-wide). The table lists
every planned pair and every kept message (first 500 rows shown); Add
Exceptions writes exactly the planned pairs as one Kerning Batch: Add
exceptions for <n> glyphs on <masters> Undo step. "Use selection" re-reads the Font window
selection. is_punctuation, expand, numeric_problem,
master_problem and Row are the original bodies; only the two Fly
imports in the last two now read the same App modules through
core.scripting.kerning_tool_backends.
Independent behaviour rewrite after Simon Cozens, Unbundle Punctuation Kerning.py,
MIT. Repository: https://github.com/simoncozens/GlyphsScripts . No code copied.
Used by fontlabapp.studios.kerning_batch (tab builder).
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 |
|---|---|---|---|
MAX_NAMES |
attribute | (shared captured text) | |
MAX_ROWS |
attribute | (shared captured text) | |
TITLE |
attribute | ||
expand |
function | (pairs: dict, groups: dict, selected: set[str], *, kept: list | None=None) -> dict |
Materialize affected effective pairs while keeping all explicit overrides. |
glyph_codes |
function | (font: Any, name: str) -> list[int] |
Code points of <code>name</code><code> in the Fontport font, else of its base name before the first </code><code>.</code>. |
is_punctuation |
function | (unicodes: list[int]) -> bool |
Use Unicode punctuation categories instead of a hard-coded name list. |
master_problem |
function | (package: Any, master: str, pairs: dict, groups: dict) -> str |
Check the writer's value limits and every existing glyph/class pair. |
numeric_problem |
function | (package: Any, master: str, pairs: dict) -> str |
Match whole-value and persistence checks without private App calls. |
plan_rows |
function | (package: Any, font: Any, snapshot: Any, names: list[str], masters: list[str], punctuation_only: bool) -> lis… |
The original <code>plan_rows</code> on a typed snapshot: planned exceptions and kept messages. |
plural |
function | (count: int, word: str) -> str |
<code>"1 glyph"</code><code> / </code><code>"2 glyphs"</code>, as the shared selection panel wrote it. |
row_edits |
function | (rows: list[Row]) -> dict |
<code>{master: {typed pair: value}}</code><code> for every row without a note (the original </code><code>write</code>). |