On Sat, Apr 25, 2009 at 03:44, Yue Wang wrote:
> Hi, Mojca:
>
> However, when comment the second line (\definetypeface [iwona] [mm]
> [math] [iwona] [default] [encoding=ec]),
> TeXExec | runtime: 1.828
> total compile time is reduced to only 2 seconds. (of course, equations
> are typeset in latin modern).

But LM should suffer from the same problem.

> How can I speed up math font loading? change add file: suffix (like
> [file:rm-iwonar])  won't help :(

Core macros need to be changed somehow if you want to achieve that.
Hans doesn't use XeTeX, so you need strong arguments to convince him
to modify XeTeX-related code.

Hans wanted to implement
    \definefontsynonym [a] [b]
to automatically work whether b is a font name, font filename or the
old good tfm font.

Even though the idea sounds OK and works well in LuaTeX, there's a big
problem with it, namely, it becomes so annoyingly slow that it's
basically useless (just for fun, you can try to remove file: in front
of LM fonts and observe the consequences). Usually filename and font
name don't match anyway, so you definitely need to specify which one
you want to use.

But there's one further problem. You can now specify file: or name:
prefix. In the first case this translates to
    \font\a=[b]
and in the second case it translates to
    \font\a="b"

For tfm fonts you however need
    \font\a=b
The second form with "b" works as well, but in that case XeTeX does
internal search by first asking fc and only if that fails it asks
kpathsea. If you don't provide either file: or name: then ConTeXt
needs to check all the three different options in the following order:
    \font\a="b"
    \font\a=b
    \font\a=[b]
I forgot whether the first one is already accepted (maybe it is), but
it any case it takes a lot of time before the right font is found.
Ideally ConTeXt should at least switch the order of searching for
fonts and should try kpatsea before fc, but then one runs into
problems with font names with spaces if one doesn't explicitely
provide the name: prefix.

The current clever scheme causes more problems & longer load times
than it brings advantages, but unless Hans changes core macros,
there's not much that you can do about it to speed up the loading
time.

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to