fontlabapp.fontui.outline_routes.straighten_all_curves
straighten_all_curves
Replace every cubic segment with its straight chord.
What: Replace every cubic segment with its straight chord. How: Native conversion removes handles; endpoints stay in place. FontLab may reset the smooth flags of both end nodes during conversion. Why: Create a polygonal version of an outline. Use: Select nodes in the current layer to choose whole contours, or leave nodes unselected for all contours. The same contour and endpoint indices apply only to layers with matching contour counts, node counts and point types. Incompatible layers are listed as kept. Inspect the curve counts, then press Apply. Benefit: Converts the chosen contours across compatible layers with a preview.
The non-modal panel previews the selected glyphs and chosen masters. A layer that has a shared, scaled or rotated outline shape is kept as a whole. 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/Straighten All Curves.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 | ||
MODE |
attribute | ||
TITLE |
attribute | ||
changes |
function | (layer: Any, reference: Any | None=None) -> list[writer.Change] |
Map selected contour and endpoint indices from the current layer. (shared captured text) |
main |
function | () -> Any |
Open one non-modal panel; replace an earlier panel of the same tool. (shared captured text) |
spans |
function | (contour: Any) -> list[list[Any]] |
Read complete line or cubic spans; refuse quadratic and open contours. (shared captured text) |