I try to use specific symbols from other (TrueType) fonts (several different fonts) in math mode (as math letters, math operators, ...). So the symbol should be defined via DeclareMathSymbol, I guess. $\mysymbol$ in the TeX file produces the error message "Font shape `U/MyFont/m/n' undefined". I could not repair it via DeclareSymbolFont and DeclareFontShape. (\MyFont{10509} and $\text{\MyFont{10509}}$ does function here, but that's not what I need.) Thanks for help.
%\listfiles
\documentclass{article}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
left=20mm,
top=20mm,
}
\usepackage{fontspec}
\usepackage{mathtools}
\title{Formula Font Test}
\author{Stefan}
\date{2017-03-15}
\newfontfamily\MyFontFamily[Path=C:/tmp/fonts/]{cambria.ttc}
% \DeclareFontFamily {} {} {}
%\DeclareFontFamily{U}{MyFamilyFont}{m}
\newcommand\MyFont[1]{\MyFontFamily\symbol{#1}}
% \DeclareSymbolFont {} {} {} {} {}
\DeclareSymbolFont{MyFontSymb}{U}{MyFont}{m}{n}
% \DeclareFontShape{U}{MyFontSymb}{m}{n}{ MyFont }{}
%\DeclareFontShape{MyFontSymb}{m}{n}{\UnicodeFontFile{cambria}{\UnicodeFontTeXLigatures}}{}
\DeclareMathSymbol{\othersymbol}{\mathalpha}{letters}{"0B}
\DeclareMathSymbol{\mysymbol}{\mathalpha}{MyFontSymb}{10509}
\usepackage{luacode}
\begin{document}
\maketitle
\MyFont{10509}
$
\othersymbol
\text{ \MyFont{10509} }
\mysymbol
$
\end{document}
