29.05.2014 Views

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

In practice we prefer a more abstract interface (at the macro level) but the idea stays the<br />

same. Interesting is that having access to the internals this way already makes our TEX Live<br />

more interesting. (We cannot demonstrate this trickery here because when this document<br />

is processed you cannot be sure if the experimental interface is still in place.)<br />

When playing with this we ran into problems with le searching. When performing the<br />

backend role, LuaTEX will look in the TEX tree if there is a corresponding virtual le. It took<br />

a while and a bit <strong>of</strong> tracing (which is not that hard in the Lua based reader) to gure out that<br />

the omega related path denitions in texmf.cnf les were not correct, something that<br />

went unnoticed because omega never had a backend integrated and the dvi processors<br />

did multiple searches to get around this.<br />

Currently, if you want to enable extensive tracing <strong>of</strong> le searching and loading, you can<br />

set an environment variable:<br />

MTX.INPUT.TRACE=3<br />

This will produce a lot <strong>of</strong> information about what le is asked for, what types (tex, font, etc)<br />

determines the search, along what paths is being searched, what readers and locators are<br />

used (le, zip, protocol), etc.<br />

AFM<br />

While Taco implemented the virtual font reader —eventually its data will be merged with<br />

the tfm table— I started playing with constructing tfm tables directly. Because ConTEXt<br />

has a rather systematic naming scheme, we can rather easily see which encoding we are<br />

dealing with. This means that in principle we can throw all encoded tfm les out <strong>of</strong> our<br />

tree and construct the tables using the afm le and an encoding vector.<br />

It took us a good day to gure out the details, but in the end we were able to trick LuaTEX<br />

into using afm les. With a bit <strong>of</strong> internal caching it was even reasonable fast. When the<br />

basic conversion mechanism was written we tried to compare the results with existing<br />

tfm metrics as generated by afm2tfm and afm2pl. Doing so was less trivial than we rst<br />

thought. To mention a few aspects:<br />

• heights and depths have a limited number <strong>of</strong> values in TEX<br />

• we need to convert to TEX's scaled points<br />

• rounding errors <strong>of</strong> one scaled point occur<br />

• afm2tfm can only add kerns when virtual fonts are used<br />

• afm2tfm adds some extra ligatures and also does some kern magic<br />

• afm2pl adds even more kerns<br />

• the tools remove kern pars between digits<br />

In this perspective we need not be too picky on what exactly a ligature is. An example<br />

<strong>of</strong> a ligature is fi and such a character can be in the font. In the tfm le, the denition<br />

32 A fresh look at fonts

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!