[tex-live] Manually unloading fonts preventing running out of memory

Philip Taylor (Webmaster, Ret'd) P.Taylor at Rhul.Ac.Uk
Mon Oct 11 12:06:27 CEST 2010



Pander wrote:

> Will Robertson, the author from fontspec, proposed the following for me to
> test:
>
> [[ begin quote ]]
>
> Use a plain XeTeX document without fontspec and load lots of fonts with
> commands like this:
>
> \def\testfont#1#2{%
>    \font#1="#2" at 12pt#1 A test of the font "#2"\par
> }
> \testfont\aaa{Palatino Linotype}
> \testfont\bbb{Georgia}
>
> You should see an increase in the memory numbers reported at the end of
> the XeTeX run (in the log file if not on the console) the more fonts you
> add.
>
> If you then write
>
> \let\aaa\relax
> \let\bbb\relax
> ...
>
> the fonts may or may not be unloaded and the memory results will change.
> You could also experiment with putting the font loading calls inside
> groups and see if that changes things as well.

It is too long since I looked inside TeX to be sure of this,
but it /may/ be that you will need to unload the fonts in
the reverse order that in which they were loaded in order
to regain all of the space allocated.

Philip Taylor


More information about the tex-live mailing list