### Punctuation symbols
$$include '../../meta/macros.ptl'

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

glyph-module

glyph-block Symbol-Punctuation-Ligation-Variants : begin
	glyph-block-import CommonShapes
	glyph-block-import Common-Derivatives
	glyph-block-import Symbol-Punctuation-Small
	glyph-block-import Symbol-Punctuation-Interpuncts
	glyph-block-import Symbol-Punctuation-Emotion

	define dotLikePunctuations : list
		* "colon"
		* "colon/mid"
		* "semicolon"
		* "period"
		* "period/mid"
		* "comma"
		* "exclam"
		* "bar"
		* "slash"
		* "backslash"
		* "question"

	define deltas : object
		"dRight"       1.0
		"dRightHalf"   0.5
		"dMid"         0
		"dLeftHalf"  (-0.5)
		"dLeft"      (-1.0)

	define [LigD baseName suffix pDelta] : if [glyph-is-needed baseName] : begin
		local delta : Math.max 0 : Width / 2 - (XH - PeriodSize) / 2
		derive-glyphs (baseName + '.lig.' + suffix) null baseName : function [src gr]
			composite-proc
				refer-glyph src
				Translate (delta * pDelta ) 0

	foreach { suffix pDelta } [Object.entries deltas] : begin
		foreach baseName [items-of dotLikePunctuations] : begin
			LigD baseName suffix pDelta
