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

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

glyph-module

glyph-block Digits-Nine : begin
	glyph-block-import CommonShapes
	glyph-block-import Common-Derivatives
	glyph-block-import Digits-Shared : OnumHeight OnumMarks ShiftDown CodeLnum CodeOnum
	glyph-block-import Digits-Six : ClosedContourSixShape OpenContourSixShape StraightBarSixShape

	create-glyph 'nine.lnum.closedContour' : glyph-proc
		include : MarkSet.capital
		include : ClosedContourSixShape CAP
		include : FlipAround (Middle) (CAP / 2)

	create-glyph 'nine.onum.closedContour' : glyph-proc
		include : OnumMarks.p
		include : ClosedContourSixShape CAP
		include : FlipAround (Middle) (OnumHeight / 2)

	create-glyph 'nine.lnum.openContour' : glyph-proc
		include : MarkSet.capital
		include : OpenContourSixShape CAP
		include : FlipAround (Middle) (CAP / 2)

	create-glyph 'nine.onum.openContour' : glyph-proc
		include : OnumMarks.p
		include : OpenContourSixShape CAP
		include : FlipAround (Middle) (OnumHeight / 2)

	create-glyph 'nine.lnum.straightBar' : glyph-proc
		include : MarkSet.capital
		include : StraightBarSixShape CAP
		include : FlipAround (Middle) (CAP / 2)

	create-glyph 'nine.onum.straightBar' : glyph-proc
		include : OnumMarks.p
		include : StraightBarSixShape CAP
		include : FlipAround (Middle) (OnumHeight / 2)

	select-variant 'nine.lnum' [CodeLnum '9'] (follow -- 'nine')
	select-variant 'nine.onum' [CodeOnum '9'] (follow -- 'nine')

	glyph-block-import Letter-Blackboard : BBS BBD
	create-glyph 'mathbb/nine' 0x1D7E1 : glyph-proc
		include : MarkSet.capital
		include : StraightBarSixShape CAP (sw -- BBS) (bbd -- BBD)
		include : FlipAround (Middle) (CAP / 2)
