# dvipdfmx and dvips do not expand fonts properly with lualatex in DVI mode

dvilualatex with microtype is supposed to support expansion, even in DVI mode. And indeed it seems to work when producing the DVI file. But then the generated file does not actually include expanded fonts: the characters are located as if they were expanded, but are not actually stretched in any way. In normal circumstances, the expansion is minimal, so this is not noticeable unless you look very closely. But using a document with some more extreme settings the problem becomes apparent.

The doucment:

\documentclass[12pt]{article}
\usepackage[utf8]{luainputenc}\usepackage[OT1]{fontenc}
\usepackage[main=english]{babel}
\usepackage[expansion=alltext,protrusion,babel,shrink=400,stretch=400,step=80]{microtype}
\usepackage{multicol}
\begin{document}
\begin{multicols*}{2}
The North Wind and the Sun were disputing which was the stronger, when a traveler came along wrapped in a warm cloak. They agreed that the one who first succeeded in making the traveler take his cloak off should be considered stronger than the other. Then the North Wind blew as hard as he could, but the more he blew the more closely did the traveler fold his cloak around him; and at last the North Wind gave up the attempt. Then the Sun shined out warmly, and immediately the traveler took off his cloak. And so the North Wind was obliged to confess that the Sun was the stronger of the two.
\end{multicols*}
\end{document}


Result with lualatex-dev (PDF mode):

Result with dvilualatex-dev (DVI mode) + dvipdfmx (dvips produces the same result):

So, you'll notice that the characters are placed as if they were stretched, but are not in fact modified at all.

Is there any way to compile a DVI to PDF with this kind of expansion? Otherwise lualatex's support for it seems useless.

• Ask the microtype maintainer. When I use dviasm on the dvi I see nothing that looks like expanded font declarations. – Ulrike Fischer Mar 6 '20 at 9:59
• I sent an email. – d909 Mar 6 '20 at 14:57
• Well, this is quite embarrassing ... seems like I never really checked whether the glyphs were actually transformed, but was tricked into believing that it worked by only looking at the changed line breaks ... so, you're right, dvilualatex does not support expansion in a useful way. – Robert Mar 7 '20 at 19:18