[lltx] Microtypography... now the user asks questions.

zappathustra zappathustra at free.Fr
Mon Feb 15 13:39:08 CET 2010


Dear all,

Thank your very much for all your work here (with special thanks to
Elie who answered all my mails and set everything in motion, even
though he was asking something from me in the first place...).

I've tested font expansion with otf fonts, and I'm very happy that it
works. Now, I have some questions...

- First, how does font expansion enter TeX's paragraph building
algorithm? Does it play a role in badness calculation or does it come
for free? (\tracingparagraphs doesn't give any information). I.e., is
there a trade-off between space manipulation and character
manipulation? And are there restrictions on adjacent lines, e.g. a
fully stretched line can't be next to a fully shrunken one (talking
about glyph expansion, of course)?
- Second, what about letterspacing (once again for better
implementation)? I know the microtypography package is supposed to do
that, but I've not had the courage to look at the code yet, and I'm
not using LaTeX anyway...
- Third, I understand that the expansion factor is given by the
following table, which I manipulate with a little bit of \directlua:

fonts.expansions.setups['default'] = {

    stretch = 2, shrink = 2, step = .5, factor = 1,

    [byte('A')] = 0.5, [byte('B')] = 0.7, [byte('C')] = 0.7,
[byte('D')] = 0.5, [byte('E')] = 0.7,
    [byte('F')] = 0.7, [byte('G')] = 0.5, [byte('H')] = 0.7,
[byte('K')] = 0.7, [byte('M')] = 0.7,
    [byte('N')] = 0.7, [byte('O')] = 0.5, [byte('P')] = 0.7,
[byte('Q')] = 0.5, [byte('R')] = 0.7,
    [byte('S')] = 0.7, [byte('U')] = 0.7, [byte('W')] = 0.7,
[byte('Z')] = 0.7,
    [byte('a')] = 0.7, [byte('b')] = 0.7, [byte('c')] = 0.7,
[byte('d')] = 0.7, [byte('e')] = 0.7,
    [byte('g')] = 0.7, [byte('h')] = 0.7, [byte('k')] = 0.7,
[byte('m')] = 0.7, [byte('n')] = 0.7,
    [byte('o')] = 0.7, [byte('p')] = 0.7, [byte('q')] = 0.7,
[byte('s')] = 0.7, [byte('u')] = 0.7,
    [byte('w')] = 0.7, [byte('z')] = 0.7,
    [byte('2')] = 0.7, [byte('3')] = 0.7, [byte('6')] = 0.7,
[byte('8')] = 0.7, [byte('9')] = 0.7,
}

and I'd like to understand it. I suppose stretch and shrink are
percentages, and step is the increment. But what about factor?
Setting, say, factor=10, is a shorthand for stretch and shrink set to
20 and step to 5, or is there something else? Finally, what do the
values apparently associated with characters represent? I've set

[byte('a')] = 5

(a probably stupid value) and it produced overfull boxes absent
otherwise.

Once again, infinite thanks... We now have the best justifcation
engine, and that's cool!

Errrr, as an aside, I've already told this to Elie, but apparently
something went wrong. I use the latest version of LuaTeX (for
Windows), i.e. v.0.5, and setting \hsize still modify the page width
(if \pagewidth isn't specified).

Paul Isambert



More information about the lualatex-dev mailing list