[XeTeX] Autoactivation

Jonathan Kew jonathan_kew at sil.org
Sat Sep 17 17:51:40 CEST 2005


On 17 Sep 2005, at 3:16 pm, Simon Spiegel wrote:

> Hi,
>
> I tried the terrific (and free) Linotype FontExplorer <http:// 
> www.versiontracker.com/dyn/moreinfo/macosx/27903> this week and a  
> question came up: FontExplorer offers autoactivation for most  
> standard apps. Although I don't know the details, it seems like it  
> catches some standard call for fonts and activates them on demand.  
> This works for apps like TextEdit etc. but not when compiling  
> something with Xe(La)TeX. Would it be possible to add this  
> functionality?Although I don't regard it as vital it would be a  
> nice feature.

I haven't experimented with this myself, but I'm confident that it  
couldn't work at present because of how XeTeX deals with fonts.

Finding fonts by name on OS X, by querying the Apple font system  
(using ATSUFindFontFromName or some such API) each time a \font  
command occurs, is relatively slow and was a performance bottleneck;  
therefore, XeTeX caches a table of all the installed fonts at startup  
(well, actually, the first time it's asked to find one) and then does  
fast lookups using that table. So when your document requests a  
certain font, XeTeX doesn't actually pass that request to the OS in  
any form that FontExplorer could monitor.

It's true that working with auto-activation would be a nice feature,  
but it would be unfortunate if it led to a significant performance  
hit for all typesetting jobs (even where the fonts used are already  
installed). It's a while, though, since I looked into this; perhaps  
Tiger has improved font lookup to the point where the name caching  
scheme XeTeX uses is no longer necessary.

One approach would be to check the cached font list, and if the  
requested font isn't already known, then query the OS; that would  
give FontExplorer a chance to activate the font, and the cache could  
be updated accordingly. This way, the performance hit would occur  
only when the font isn't already installed/active.

Jonathan



More information about the XeTeX mailing list