Skip to content

fontlabapp.studios.shape_generators.myanmar

myanmar

Generate width-fitted Myanmar medial-ra variants on every FontLab master.

What: Group consonants on the current master. Fit the same group members on all masters, using each master's mean advance minus its own template enclosure. Names use the current master's group means floored to tens. Also create eight unstretched omission variants. Existing names and targets with a bad master are kept, with the master and reason listed. How: Read U+1000–U+1020 by Unicode or hexadecimal name. Verify the five pieces: stem, top rail, top hook, bottom rail, bottom hook. The stem must be tallest; top pieces above bottom pieces; hooks right of rails. The rails' closing edges must be on their right, the hooks' on their left. Copy through the shared App contour copier. Show every target's extension and node/handle bounds on every master in the Preview table. Apply refuses source data changed since Preview. Why: Fit this five-part Myanmar outline to consonant width groups. All-master output keeps the generated glyph structure consistent across masters; a failed template keeps the entire target. Use: Select one template, or leave the selection empty to use U+103C. Inspect Preview and consent to any listed automatic-glyph rebuilds, then Apply. Each new glyph is recorded as its own Undo step, and the outlines as one more Undo step. Benefit: Produce a compatible set of fitted medial-ra variants for refinement.

Credit: Independent behaviour-only rewrite of Simon Cozens, GlyphsScripts/Myanmar Medial Ra Maker.py, MIT, copyright 2017. Repository: https://github.com/simoncozens/GlyphsScripts . No source code copied.

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
KEY attribute
PIECES attribute
TITLE attribute
VARIANTS attribute
consonant_widths function (package: Any, records: list[Any]) -> tuple[list[tuple[str, float]], list[RaRow]] Read named current-master advances; retain invalid consonants as kept rows.
default_source function (records: list[Any]) -> str Use the encoded medial ra when the selection is not one template glyph.
fitted_bounds function (contours: list[Any], variant: str, extension: float) -> tuple[float, float, float, float] Envelope of all fitted nodes and handles, for the pre-write table.
main function () -> Any Open or replace the owned generator panel.
master_extension function (package: Any, master: str, members: tuple[str, ...], enclosure: float) -> float Mean advance of the same consonant members, minus this master's enclosure.
panel_type function () -> type Use the shared non-modal creation panel, with a complete multi-master preview.
piece_indices function (variant: str) -> list[int] Choose the stem, rails and hooks present in an omission variant.
piece_points function (points: list[tuple[float, float]], piece: int, extension: float) -> list[tuple[float, float]] Stretch closing-edge endpoints and move hook bodies on detached copies.
point_bounds function (points: list[tuple[float, float]]) -> tuple[float, float, float, float] Return bounds of nodes and handles, a conservative contour envelope.
prepare function (rows: list[RaRow]) -> list[Any] Prepare every master on detached contours before any Add Glyph command.
preview_key function (rows: list[RaRow]) -> tuple[Any, ...] Immutable target and source values that the user saw before Apply.
stem_measure function (contour: Any) -> float Distance between the two longest distinct vertical straight edges.
survey function (package: Any, source: str, records: list[Any], count: int, facts: Any, consent: bool) -> list[RaRow] Plan each target on every master.
template_contours function (layer: Any) -> tuple[list[Any], float] Copy five contours, verify piece roles and stretch sides, measure enclosure.
width_classes function (values: list[float], count: int) -> list[int] Return the rounded names of the width groups.
width_groups function (values: list[tuple[str, float]], count: int) -> list[tuple[int, tuple[str, ...]]] Optimal contiguous groups, preserving glyph identities and multiplicities.