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

import [mix linreg clamp fallback] from "@iosevka/util"

glyph-module

glyph-block Letter-Cyrillic-Lower-Be : begin
	glyph-block-import CommonShapes
	glyph-block-import Common-Derivatives

	create-glyph 'cyrl/be' 0x431 : glyph-proc
		local df : include : DivFrame 1
		include : df.markSet.b

		local yRingTop : Math.min (XH + O) (XH - QuarterStroke)
		local ada : df.archDepthAOf : SmallArchDepth * yRingTop / XH
		local adb : df.archDepthBOf : SmallArchDepth * yRingTop / XH

		include : dispiro
			widths.rhs ShoulderFine
			straight.up.start (SB + OX + [HSwToV : Stroke - ShoulderFine]) (yRingTop - ada)
			arch.rhs yRingTop (swBefore -- ShoulderFine)
			flat (RightSB - OX) (yRingTop - adb)
			curl (RightSB - OX) ada
			arch.rhs 0
			flat (SB + OX) adb
			curl (SB + OX) (yRingTop - ada)
			alsoThruThem [list {0.3 0.85} {0.65 0.925}] important g4
			g4   (RightSB - [HSwToV : Stroke / 16]) Ascender [heading Rightward]
