# [luatex] rotate glyphs correctly – low level

Arno Trautmann Arno.Trautmann at gmx.de
Sun Feb 3 19:25:15 CET 2013

Hi all,

after having spent some evenings trying and freaking out about not
getting it, I give up and have to bother you: I want to invert every
glyph in a line, i.e. mirror it on a vertical axis. I want to do this in
the post_linebreak_filter, and the result should just be like using
LaTeXs \reflectbox{} on every glyph. So, I managed to rotate by using
either a pdf_setmatrix node or a pdf_literal one. But I never get the
positioning right. When I tried to understand what \reflectbox does, I
only understood that it is something like

a\reflectbox{b}c
=> a \pdfsave \pdfsetmatrix{-1 0 0 1}b\pdfrestore c

but that gives a wrong spacing.

So, I wanted to ask for a complete solution as I seem to be unable to
fiddle things out – Heiko tried to point me to understanding in this
mail: http://tug.org/pipermail/luatex/2011-November/003336.html but I
don't get it, sorry.

Long text, short question: How do I vertically mirror a glyph in a node
list given in the post_linebreak_filter without disturbing the
horizontal spacing?

Cheers
Arno