$$include '../../meta/macros.ptl'

import [mix linreg clamp fallback] from "@iosevka/util"
import [DesignParameters] from "../../meta/aesthetics.mjs"

glyph-module

glyph-block Letter-Greek-Lower-Sigma : begin
	glyph-block-import CommonShapes
	glyph-block-import Common-Derivatives

	create-glyph 'grek/sigma' 0x3C3 : glyph-proc
		include : MarkSet.e
		local fine : clamp [AdviceStroke 8] (Stroke * 0.625) (Stroke * 0.25)
		include : dispiro
			widths.lhs
			flat (RightSB + SideJut + [HSwToV : 0.15 * Stroke]) XH [heading Leftward]
			curl Middle (XH - O) [heading Leftward]
			archv
			flat (SB + OX) (XH - SmallArchDepthA)
			curl (SB + OX) SmallArchDepthB
			arch.lhs 0
			flat RightSB SmallArchDepthA
			curl RightSB (XH - SmallArchDepthB)
			arcvh
			g4.left.end Middle (XH - Stroke + fine - O) [widths.lhs.heading fine Leftward]
