# [XeTeX] fontspec limits

Will Robertson will at guerilla.net.au
Fri Dec 17 06:56:19 CET 2004

Hi

It's been on my list of things to do (actually, I never wrote it down,
but it's been in the back of my head) to see how many times I can run
\fontspec before something goes wrong.

After being run for the first time, a fontspec command with constant
arguments does little except choose the already defined font. The
problem is that you can only call the \font command so many times
before XeTeX bottoms out, and this is necessary in the current version
of the package every time \fontspec is called. This minimal example
fails somewhere near the end:

\documentclass{article}
\begin{document}
\newcount\zfcount
\fontspec{Hoefler Text}
% \font\1="Hoefler Text" at 10pt\1 % this line instead also fails
fontspec loop test \number\zfcount\par
\ifnum\zfcount < 2000 \repeat
\end{document}

I will try and think out a more robust interface for cases when you
want to define a fontspec instance for repetitive tasks like section