$$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-Xeh : begin
	glyph-block-import CommonShapes
	glyph-block-import Common-Derivatives
	glyph-block-import Letter-Shared-Shapes : SerifFrame
	glyph-block-import Letter-Latin-Lower-AE-OE : SubDfAndShift

	do "Xeh"
		create-glyph 'armn/Xeh' 0x53D : glyph-proc
			local df : include : DivFrame para.advanceScaleMM 3
			local { subDf shift } : SubDfAndShift 1 df
			include : df.markSet.capital
			include : VBar.l df.leftSB 0 CAP df.mvs
			include : HBar.t df.leftSB df.middle XH df.mvs
			include : with-transform [ApparentTranslate shift 0]
				UShape subDf XH 0 subDf.mvs subDf.archDepthA subDf.archDepthB
			if SLAB : begin
				local sf : SerifFrame.fromDf df CAP 0
				local sf2 : SerifFrame.fromDf df XH 0
				include : composite-proc sf.lt.full sf.lb.full
				if sf2.enoughSpaceForFullSerifs
					include : composite-proc sf2.mt.full sf2.rt.full
					include sf2.rt.outer
