-- lx-bundle:true

--- Mathematical italic Greek codepoints and their TeX command identities
-- @module plugins.mdpreview.math.italic_greek

--[[
Use:

local glyph = utf8.char(ITALIC_GREEK.alpha)

One architectural caution: keep semantic command identity separate from the final Unicode value:
{
	command = "alpha",
	class = "ordinary",
	style = "italic",
	base_codepoint = 0x03B1,
	styled_codepoint = 0x1D6FC,
}
That lets you fall back to ordinary α when a font lacks 𝛼, and it avoids losing the difference between the parsed command and its selected font glyph. Unicode also warns that mathematical alphanumeric characters encode meaningful stylistic distinctions and compatibility-normalize to their base letters.
]]

local ITALIC_GREEK = {
	-- Capitals
	Alpha   = 0x1D6E2,
	Beta    = 0x1D6E3,
	Gamma   = 0x1D6E4,
	Delta   = 0x1D6E5,
	Epsilon = 0x1D6E6,
	Zeta    = 0x1D6E7,
	Eta     = 0x1D6E8,
	Theta   = 0x1D6E9,
	Iota    = 0x1D6EA,
	Kappa   = 0x1D6EB,
	Lambda  = 0x1D6EC,
	Mu      = 0x1D6ED,
	Nu      = 0x1D6EE,
	Xi      = 0x1D6EF,
	Omicron = 0x1D6F0,
	Pi      = 0x1D6F1,
	Rho     = 0x1D6F2,

	Sigma   = 0x1D6F4,
	Tau     = 0x1D6F5,
	Upsilon = 0x1D6F6,
	Phi     = 0x1D6F7,
	Chi     = 0x1D6F8,
	Psi     = 0x1D6F9,
	Omega   = 0x1D6FA,

	nabla   = 0x1D6FB,

	-- KaTeX's 'var' capitals select the italic forms of the same Greek letters
	varGamma   = 0x1D6E4,
	varDelta   = 0x1D6E5,
	varTheta   = 0x1D6E9,
	varLambda  = 0x1D6EC,
	varXi      = 0x1D6EF,
	varPi      = 0x1D6F1,
	varSigma   = 0x1D6F4,
	varUpsilon = 0x1D6F6,
	varPhi     = 0x1D6F7,
	varPsi     = 0x1D6F9,
	varOmega   = 0x1D6FA,

	-- Lowercase
	alpha   = 0x1D6FC,
	beta    = 0x1D6FD,
	gamma   = 0x1D6FE,
	delta   = 0x1D6FF,
	epsilon = 0x1D700,
	zeta    = 0x1D701,
	eta     = 0x1D702,
	theta   = 0x1D703,
	iota    = 0x1D704,
	kappa   = 0x1D705,
	lambda  = 0x1D706,
	mu      = 0x1D707,
	nu      = 0x1D708,
	xi      = 0x1D709,
	omicron = 0x1D70A,
	pi      = 0x1D70B,
	rho     = 0x1D70C,

	-- Final sigma is distinct in Unicode, but is not normally
	-- exposed as a standard TeX math command.
	finalsigma = 0x1D70D,

	sigma   = 0x1D70E,
	tau     = 0x1D70F,
	upsilon = 0x1D710,
	phi     = 0x1D711,
	chi     = 0x1D712,
	psi     = 0x1D713,
	omega   = 0x1D714,

	partial = 0x1D715,

	-- Variant forms
	varepsilon = 0x1D716,
	vartheta   = 0x1D717,
	thetasym   = 0x1D717,
	varkappa   = 0x1D718,
	varphi     = 0x1D719,
	varrho     = 0x1D71A,
	varpi      = 0x1D71B,
}

return ITALIC_GREEK
