analyze_kerning_groups
Determines and assigns professional kerning groups for every glyph, using dictionary lookup, component inheritance, and contour analysis to replace missing or wrong groups.
Instructions
Analyze and assign kerning groups to all glyphs.
RECIPE: For a complete kerning workflow (groups → pairs → verification), call get_recipe("kerning_from_scratch") first.
Assigns correct groups to all glyphs, overwriting any existing values. Uses a five-tier resolution strategy:
Dictionary lookup for ~80 base glyphs (A-Z, a-z, figures, punctuation)
Dot-suffix stripping (a.ss01 → a)
Component inheritance for accented/composite glyphs (Aacute → A)
Unicode decomposition fallback
Contour analysis fallback (ray-casting edge detection)
Group names follow professional conventions (key glyph = group name):
UC left: H (straight stem), O (round), A (diagonal), V, T, S, etc.
UC right: H (straight), O (round), D (half-round), E (horizontal), etc.
LC left: h (straight), o (round), v (diagonal), f, etc.
LC right: h (straight), n (arch), o (round), etc.
Figures: each gets its own group (shapes too varied)
Does not modify glyph colors by default. Set mark_glyphs=True only when
the user explicitly asks to mark applied or proposed group changes.
Args: glyph_names: Optional list of glyph names (default: all Letter/Number/Punctuation glyphs) apply: If True (default), assign groups. If False, dry run only. overwrite: If True (default), overwrite existing groups. If False, only assign to empty slots. mark_glyphs: Color affected glyphs only when explicitly requested.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apply | No | ||
| overwrite | No | ||
| glyph_names | No | ||
| mark_glyphs | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |