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

Pander pander at users.sourceforge.net
Mon Oct 11 11:56:39 CEST 2010


Hi all,

When using many different fonts, in e.g. XeLaTeX, the following error will
occur:

! Font ... at 10.0pt not loaded: Not enough room left.

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.

If this does save us the memory, then I'll be able to add a feature in
fontspec along the lines of

\newfontfamily\abc{...}
...
\unloadfontfamily\abc

[[ end quote ]]

I, with my limited TeX knowledge, did not succeed in getting less memory
usage. Which TeX expert could please help us out?

Thanks,

Pander



More information about the tex-live mailing list