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

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

glyph-module

glyph-block Letter-Greek-Upper-Xi : begin
	glyph-block-import CommonShapes
	glyph-block-import Common-Derivatives

	create-glyph 'grek/Xi' 0x39E : glyph-proc
		include : MarkSet.capital
		local xMidLeft  : mix SB RightSB 0.125
		local xMidRight : mix RightSB SB 0.125
		local yBar : [mix 0 CAP 0.5] + Stroke * 0.125
		include : HBar.m xMidLeft xMidRight yBar
		include : HBar.t (SB + OX) (RightSB - OX) CAP
		include : HBar.b (SB + OX) (RightSB - OX) 0
		if SLAB : begin
			include : VSerif.dl (SB + OX) CAP VJut
			include : VSerif.dr (RightSB - OX) CAP VJut
			include : VSerif.ul (SB + OX) 0 VJut
			include : VSerif.ur (RightSB - OX) 0 VJut
			include : VBar.l xMidLeft (yBar - 0.5 * VJut) (yBar + 0.5 * VJut) [AdviceStroke 3.5]
			include : VBar.r xMidRight (yBar - 0.5 * VJut) (yBar + 0.5 * VJut) [AdviceStroke 3.5]
