How can the font cryst be used in asymptote in particular with WebGL output?
1. PDF output of Asymptote
Consider my file label3zoom.tex:
\documentclass{article}
\usepackage[inline]{asymptote}
% \DeclareFontFamily{U}{cry}{\hyphenchar\font=-1}
% \DeclareFontShape{U}{cry}{m}{n}{ <-> cryst}{}
% \newcommand{\cry}[1]{{\usefont{U}{cry}{m}{n} \symbol{#1}}}
\begin{document}
% Hello cryst ``\cry{41}'' % works
\begin{asydef}
import three;
texpreamble("\DeclareFontFamily{U}{cry}{\hyphenchar\font=-1}");
texpreamble("\DeclareFontShape{U}{cry}{m}{n}{ <-> cryst}{}");
texpreamble("\newcommand{\cry}[1]{{\usefont{U}{cry}{m}{n} \symbol{#1}}}");
\end{asydef}
\begin{center}
\begin{asy}
currentlight=Headlamp;
size(400pt,400pt);
currentprojection=oblique;
draw(scale3(4)*extrude("Hello cryst ``\cry{41}''",2Z), material(blue));
\end{asy}
\end{center}
\end{document}
The sequence
$ pdflatex label3zoom.tex
$ asy label3zoom-*.asy
$ pdflatex label3zoom.tex
gives me following output:
As you can see the \cry{41} command does not produce any output. In pdflatex \cry{41} prints a little square with spikes in the corners
Why is there only whitespace in the output of Asymptote and how can I fix this?
2. WebGL output of Asymptote
One can generate with
$ asy --version
Asymptote version 2.70 [(C) 2004 Andy Hammerlindl, John C. Bowman, Tom Prince]
ENABLED OPTIONS:
WebGL 3D HTML rendering
...
and the flag -f html
$ asy -f html label3zoom.asy
HTML pages with WebGL rendering. This works for the official example label3zoom.asy.
I assume when the problem with the pdf output is fixed, the webgl output might work as well. But I will see.
I am on macOS 10.15.7 using MacTeX-2021 based on current TeXLive 2021.



pen fpen=font("U","cry","m","n"); label("\symbol{41}",(0mm,-10mm),fpen+blue);but I didn't manage to put this inside anextrudecommand. – Marijn Aug 26 '21 at 15:52\cry{41}is not smooth. You can test another math symbols. – Nguyen Van Chi Aug 27 '21 at 08:04