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

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


glyph-module

glyph-block Letter-Latin-Middle-Welsh-V : begin
	glyph-block-import CommonShapes
	glyph-block-import Common-Derivatives

	define [MiddleWelshVShape top pL pR] : glyph-proc
		include : dispiro
			widths.lhs
			g4 Middle (top - O / 2)
			g4.down.mid (SB + O) [mix 0 top (pL * SmallArchDepthB / (SmallArchDepthA + SmallArchDepthB))]
			arch.lhs 0
			g4 (RightSB - O) [mix 0 top (pR * SmallArchDepthA / (SmallArchDepthA + SmallArchDepthB))]
			g4 [mix SB RightSB 0.75] [mix 0 top pR]

	create-glyph 'VMiddleWelsh' 0x1EFC : glyph-proc
		include : MarkSet.capital
		include : MiddleWelshVShape CAP 0.75 0.625

	create-glyph 'vMiddleWelsh' 0x1EFD : glyph-proc
		include : MarkSet.capital
		include : MiddleWelshVShape Ascender 0.625 0.625
