Inspired by David Carlisle's answer and comment from my previous question, I wanted to see if I could try and redefine the math mode accent macros (\bar, \hat, \dot, etc.) to kern specifically for \mathbb and \mathcal inputs because I want to use AMS blackboard bold and Computer Modern calligraphic respectively instead of Latin Modern's in LuaTeX with unicode-math.
Here's my MWE:
% !TEX program = lualatex
% DOCUMENT CLASS
\documentclass[11pt,preview,varwidth,%
border={3pt 5pt 3pt 5pt}% left bottom right top
]{standalone}
% PACKAGES
\usepackage{amsmath}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
\let\lmmathbb\mathbb % Latin Modern blackboard bold
\let\lmmathcal\mathcal % Latin Modern calligraphic
\DeclareMathAlphabet{\amsmathbb}{U}{msb}{m}{n} % AMS blackboard bold
\DeclareMathAlphabet{\cmmathcal}{OMS}{cmsy}{m}{n} % Computer Modern calligraphic
% START OF DOCUMENT
\begin{document}
\begin{tabular}{lcr}
Latin Modern's \verb|\mathbb| & : & (\bar{\lmmathbb{A}} \hat{\lmmathbb{A}} \vec{\lmmathbb{A}} \dot{\lmmathbb{A}} \ddot{\lmmathbb{A}}) \
(\cmmathcal{AMS})'s \verb|\mathbb| (with \textit{unkerned} accents) & : & (\bar{\amsmathbb{A}} \hat{\amsmathbb{A}} \vec{\amsmathbb{A}} \dot{\amsmathbb{A}} \ddot{\amsmathbb{A}}) \
Latin Modern's \verb|\mathcal| & : & (\bar{\lmmathcal{A}} \hat{\lmmathcal{A}} \vec{\lmmathcal{A}} \dot{\lmmathcal{A}} \ddot{\lmmathcal{A}}) \
Computer Modern's \verb|\mathcal| (with \textit{unkerned} accents) & : & (\bar{\cmmathcal{A}} \hat{\cmmathcal{A}} \vec{\cmmathcal{A}} \dot{\cmmathcal{A}} \ddot{\cmmathcal{A}})
\end{tabular}
\end{document}
% END OF DOCUMENT
I want to achieve the following:
.
.
.
\begin{tabular}{lcr}
Latin Modern's \verb|\mathbb| & : & \(\bar{\lmmathbb{A}} \hat{\lmmathbb{A}} \vec{\lmmathbb{A}} \dot{\lmmathbb{A}} \ddot{\lmmathbb{A}}\) \\
\(\cmmathcal{AMS}\)'s \verb|\mathbb| (with \textit{kerned} accents) & : & \(\bar{\amsmathbb{A}} \hat{\amsmathbb{A}} \vec{\amsmathbb{A}} \dot{\amsmathbb{A}} \ddot{\amsmathbb{A}}\) \\
Latin Modern's \verb|\mathcal| & : & \(\bar{\lmmathcal{A}} \hat{\lmmathcal{A}} \vec{\lmmathcal{A}} \dot{\lmmathcal{A}} \ddot{\lmmathcal{A}}\) \\
Computer Modern's \verb|\mathcal| (with \textit{kerned} accents) & : & \(\bar{\cmmathcal{A}} \hat{\cmmathcal{A}} \vec{\cmmathcal{A}} \dot{\cmmathcal{A}} \ddot{\cmmathcal{A}}\)
\end{tabular}
.
.
.



\usepackage{unicode-math}and use simply$\hat{\cal A}$then the result is correct. Moreover, I tried OpTeX with Unicode math and with LatinModern-Math main font and \cal from Computer Modern (see OpTeX trick http://petr.olsak.net/optex/optex-tricks.html#orical ) and the result is correct too. – wipet Nov 30 '22 at 05:31