Skip to content

fontlabapp.studios.shape_generators.sandblast

sandblast

Add small irregular counters inside closed outlines.

What: Add small irregular counters inside closed outlines. How: Use a reproducible seed and bounded placement attempts. Keep each hole wholly inside the combined filled shape, outside existing counters, and separate from other holes. Cache placements per scan and control setting. Orient each hole opposite its innermost containing contour. Why: Create a distressed outline without a rejection loop that can hang. Use: Set hole count, radius and seed. Inspect the placed count, then Apply. Benefit: Creates editable counters; the preview reports the count actually placed.

The non-modal panel previews the selected glyphs and chosen masters. Shared, scaled and rotated outline shapes are kept. Automatic-layer owners are kept. Bases of automatic composites are kept unless the shared consent option is enabled. Each Apply is recorded as one Undo step through the App history writer. Reload after changing the selection.

Independent behaviour rewrite after Simon Cozens, GlyphsScripts/Sandblast.py, MIT, copyright 2017 Simon Cozens. Repository: https://github.com/simoncozens/GlyphsScripts . No source code was 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
TITLE attribute
changes function (layer: Any, count: int, radius: float, seed: int, cache: dict | None=None) -> list[writer.Change] Use each shape's combined filled path, including existing counters.
fl attribute (shared captured text)
holes function (path: Any, bounds: tuple[float, float, float, float], count: int, radius: float, seed: int) -> list[list[tup… Place disjoint polygon holes; stop after a bounded number of attempts.
main function () -> Any Open one non-modal panel; replace an earlier panel of the same tool. (shared captured text)
outline_panel attribute (shared captured text)
point_lists_match function (actual: list[list[writer.Point]], expected: list[list[writer.Point]]) -> bool Compare stored contour counts, node counts and coordinates within half a unit. (shared captured text)
qt attribute (shared captured text)
writer attribute (shared captured text)