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

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

glyph-module

glyph-block Mark-Shared-Metrics : begin
	glyph-block-import CommonShapes
	glyph-block-import Common-Derivatives

	### Combining marks
	glyph-block-export markExtend markStroke markHalfStroke markStress markFine
	define markExtend (AccentWidth * 0.5)
	define markStroke : Math.min [AdviceStroke2 3.375 4 XH] (0.875 * AccentHeight)
	define markHalfStroke : 0.5 * markStroke
	define markStress : markHalfStroke * 1.1
	define markFine : Math.min (markHalfStroke * 0.9) (0.5 * [AdviceStroke2 3.875 4.25 XH])

	glyph-block-export asciiMarkZoomX asciiMarkZoomY
	define asciiMarkZoomX : (RightSB - SB) / (markExtend * 3)
	define asciiMarkZoomY : 1.25 * asciiMarkZoomX

	glyph-block-export markMiddle markDotsRadius dialytikaRadius
	define markMiddle (-Middle)
	define markDotsRadius : DotRadius * [Math.min 1 (markStress / HalfStroke)]
	define dialytikaRadius : DotRadius * [Math.min 1 ([AdviceStroke 5] / Stroke)]
