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

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

glyph-module

glyph-block Letter-Armenian-Upper-Cheh : begin
	glyph-block-import CommonShapes
	glyph-block-import Common-Derivatives

	# Common Params
	define barPos : XH / 2
	define highBarPos XH
	define jut Jut

	do "Cheh"
		create-glyph 'armn/Cheh' 0x543 : glyph-proc
			local df : include : DivFrame 1
			include : df.markSet.capital
			local x1 : mix df.leftSB df.rightSB 0.75
			include : dispiro
				widths.lhs df.mvs
				flat x1 CAP
				curl df.middle CAP
				archv
				flat df.leftSB (CAP - ArchDepthA)
				curl df.leftSB (0 + ArchDepthB)
				arcvh
				flat df.middle 0
				curl df.rightSB 0
			include : dispiro
				widths.rhs df.mvs
				flat (df.leftSB - jut + [HSwToV : 0.5 * df.mvs]) highBarPos
				curl df.middle highBarPos
				archv
				flat df.rightSB (highBarPos - ArchDepthA)
				curl df.rightSB 0 [heading Downward]
