[lltx] Re: luamicrotype?

Will Robertson wspr81 at gmail.com
Wed Feb 24 00:06:55 CET 2010

On 24/02/2010, at 6:06 AM, Elie Roux wrote:

>> Just recently I have been working on microtype in a luatex context, and fortunately, it isn't all that difficult. The pdftex primitives pertinent for protrusion and expansion still exist in luatex and will -- in sha' Taco -- exist in the future, too. They also work with otf fonts, so the main problem to solve here was how to convert the characters in the configuration (where the user may specify them straight-forwardly as 'A', '\textendash' or '©' etc.) into slot numbers in the font. This has been puzzled out, so microtype now also works with opentype fonts, as long as you stick to the NFSS, eg.:
> Great! I don't have time to see how this works tonight, but I'll try to take a look tomorrow. Does it work with the latest CTAN version?

Didn't I mention that the latest version of microtype supported LuaTeX? :)
To be honest though I've been too busy to look at what it was doing.

>> It does not yet work with fontspec of course, however, only because the latter deviates from the NFSS. I do not see the principal difficulties you seem to make out. It should not be too hard to teach microtype about fontspec, so that it is able do its task of activating microtypography both systematically (if the font is included in the set of fonts that should be activated) as well as in an ad-hoc manner (eg., \fontspec[protrusion]{font}). Probably all that's required on fontspec's part is a hook to call microtype once the font is loaded.

Since fontspec "layers" on top of the NFSS, it should be easy enough to either add support for microtype in fontspec or add support for fontspec in microtype. The rule, at present, for constructing a new NFSS family is to take the base font name (say "TeX Gyre Termes"), strip out any spaces, then append a counter to it depending how many times its been loaded with different font features. E.g., "TeXGyreTerms(3)".

If you would like a more robust string to parse/normalise than "(x)", this is easy to arrange.

-- Will

More information about the lualatex-dev mailing list