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

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

glyph-module

glyph-block Symbol-Mosaic-Dentistry : begin
	glyph-block-import CommonShapes
	glyph-block-import Common-Derivatives
	glyph-block-import Symbol-Geometric-Shared : GeometricDim
	glyph-block-import Mark-Above : TildeShape

	define boxDrawingStroke : AdviceStroke 3.5

	for-width-kinds WideWidth4
		create-glyph [MangleName 'vertAndTopRightLine'] [MangleUnicode 0x23BE] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName : NameUni 0x23BA
			include : refer-glyph : MangleName : NameUni 0x23B8
		create-glyph [MangleName 'vertAndBottomRightLine'] [MangleUnicode 0x23BF] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName : NameUni 0x23BD
			include : refer-glyph : MangleName : NameUni 0x23B8
		create-glyph [MangleName 'vertAndTopLeftLine'] [MangleUnicode 0x23CB] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName : NameUni 0x23BA
			include : refer-glyph : MangleName : NameUni 0x23B9
		create-glyph [MangleName 'vertAndBottomLeftLine'] [MangleUnicode 0x23CC] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName : NameUni 0x23BD
			include : refer-glyph : MangleName : NameUni 0x23B9

	for-width-kinds WideWidth1
		define Geom : GeometricDim MosaicUnitWidth MosaicWidth

		define [WaveShape] : TildeShape
			Geom.MidY + Geom.Size / 2
			Geom.MidY - Geom.Size / 2
			* Geom.Left
			* Geom.Right
			boxDrawingStroke / 2

		create-glyph [MangleName 'vertAndTopLine'] [MangleUnicode 0x23C9] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName : NameUni 0x2502
			include : refer-glyph : MangleName : NameUni 0x23BA
		create-glyph [MangleName 'vertAndBottomLine'] [MangleUnicode 0x23CA] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName : NameUni 0x2502
			include : refer-glyph : MangleName : NameUni 0x23BD

		create-glyph [MangleName 'vertLineWithCircle'] [MangleUnicode 0x23C0] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName : NameUni 0x2502
			include : refer-glyph : MangleName 'whiteCircle'
		create-glyph [MangleName 'vertAndTopLineWithCircle'] [MangleUnicode 0x23C1] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName 'vertAndTopLine'
			include : refer-glyph : MangleName 'whiteCircle'
		create-glyph [MangleName 'vertAndBottomLineWithCircle'] [MangleUnicode 0x23C2] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName 'vertAndBottomLine'
			include : refer-glyph : MangleName 'whiteCircle'

		create-glyph [MangleName 'vertLineWithTriangle'] [MangleUnicode 0x23C3] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName : NameUni 0x2502
			include : refer-glyph : MangleName 'whiteTriangleUp'
		create-glyph [MangleName 'vertAndTopLineWithTriangle'] [MangleUnicode 0x23C4] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName 'vertAndTopLine'
			include : refer-glyph : MangleName 'whiteTriangleUp'
		create-glyph [MangleName 'vertAndBottomLineWithTriangle'] [MangleUnicode 0x23C5] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName 'vertAndBottomLine'
			include : refer-glyph : MangleName 'whiteTriangleUp'

		create-glyph [MangleName 'vertLineWithWave'] [MangleUnicode 0x23C6] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName : NameUni 0x2502
			include : WaveShape
		create-glyph [MangleName 'vertAndTopLineWithWave'] [MangleUnicode 0x23C7] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName 'vertAndTopLine'
			include : WaveShape
		create-glyph [MangleName 'vertAndBottomLineWithWave'] [MangleUnicode 0x23C8] : glyph-proc
			set-width MosaicWidth
			include : ForceUpright
			include : refer-glyph : MangleName 'vertAndBottomLine'
			include : WaveShape
