# How to change the version of \ell being used while keeping the same font?

I have recently been trying out the stix font, and while I enjoy the font I am not a fan of the version of \ell it uses by default, and I would much prefer the default \ell I had previously. Is it possible to make this change without changing fonts all together?

To clarify,

Undesired current \ell:

Desired \ell:

There is no “previous” \ell. That glyph is the one in Computer Modern Math and the shape is what the font designer (D. Knuth) decided. The designer of STIX Two chose a different rendering to blend it with the other lowercase calligraphic (cursive) letters, of which the font has the complete set. To the contrary, Computer Modern has just the “cursive l” in that set.

This said, you can import the \ell of Computer Modern in quite an easy way. In fontmath.ltx you find

\DeclareMathSymbol{\ell}{\mathord}{letters}{"60}


and

\DeclareSymbolFont{letters}{OML}{cmm}{m}{it}
\SetSymbolFont{letters}{bold}{OML}{cmm}{b}{it}


so all it takes is

\documentclass{article}
\usepackage{stix2}
\usepackage{fix-cm}

\DeclareSymbolFont{CMletters}{OML}{cmm}{m}{it}
\SetSymbolFont{CMletters}{bold}{OML}{cmm}{b}{it}

\DeclareMathSymbol{\ell}{\mathord}{CMletters}{"60}

\begin{document}

This is $\ell$. Note that it's different
from $\mathscr{l}$.

\end{document}


In unicode-math, you can replace a specific symbol with range=:

\documentclass{article}
\usepackage{unicode-math}

\setmainfont{STIX Two Text}
\setmathfont{STIX Two Math}
\setmathfont{NewCMMath-Regular}[
range=\ell,
Scale=MatchLowercase]

\begin{document}
STIX Two $$f$$

New Computer Modern $$\ell$$
\end{document}