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

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

glyph-module

glyph-block Letter-Cyrillic-Dzhe : begin
	glyph-block-import CommonShapes
	glyph-block-import Common-Derivatives
	glyph-block-import Letter-Shared-Shapes : SerifFrame
	glyph-block-import Mark-Adjustment : ExtendBelowBaseAnchors

	define [CyrDzheShape top] : glyph-proc
		include : VBar.l SB 0 top
		include : HBar.b SB RightSB 0
		include : VBar.r RightSB 0 top
		local desc : (-LongVJut) + QuarterStroke
		include : VBar.m Middle desc Stroke VJutStroke
		include : ExtendBelowBaseAnchors desc
		if SLAB : let [sf : SerifFrame.fromDf [DivFrame 1] top 0] : begin
			include : composite-proc sf.lt.full sf.rt.full sf.lb.outer sf.rb.outer

	create-glyph 'cyrl/Dzhe' 0x40F : glyph-proc
		include : MarkSet.capital
		include : CyrDzheShape CAP

	create-glyph 'cyrl/dzhe.upright' : glyph-proc
		include : MarkSet.e
		include : CyrDzheShape XH
