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

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

glyph-module

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

	create-glyph 'cyrl/uk' 0xA64B : glyph-proc
		include : MarkSet.b

		local kLeftX  0.8
		local kLeftY  0.875
		local kRightX 1
		local kRightY 1
		local yCross : mix 0 Ascender 0.45

		local stress : AdviceStroke 2.75
		local fine : AdviceStroke 3

		local smallRingRadius : (0.25 * (RightSB - SB)) + 0.5 * fine
		local subDf : DivFrame ((2 * smallRingRadius + 2 * SB) / Width)
		local ada : ArchDepthAOf smallRingRadius subDf.width
		local adb : ArchDepthBOf smallRingRadius subDf.width

		include : dispiro
			g4.down.start [mix Middle SB kLeftX] [mix 0 Ascender kLeftY] [widths.lhs.heading stress Downward]
			g4 Middle yCross [widths.center stress]
			g4 (Middle + smallRingRadius - OX) ada [widths.rhs fine]
			arch.rhs 0 (sw -- fine)
			g4 (Middle - smallRingRadius + OX) adb
			g4 Middle yCross [widths.center stress]
			g4.up.mid [mix Middle RightSB kRightX] [mix 0 Ascender kRightY] [widths.lhs.heading stress Upward]
