This is from my series of questions "Can TeX do weird stuff?"
Today I want to know if TeX can simulate bad typography. I'm not talking about ugly templates, like wordlike
or (god forgive me for this) abntex2
, these are easy and not ugly enough.
I'm talking about nightmare-inducing poorly-kerned typography. I have seen lots of documents that the letters overlap each other and have irregular spacing, but could not find them for this question.
The closest thing I could find was (behold!) this:
and this:
I tried \let
ting and \def
fing \kern
and \glue
to \relax
and to a fixed amount, but none of these worked.
Is it possible to disable, or even better, completely messing up TeX's inter-letter spacing? Random inter-letter spacing would be perfect!
Best Answer
An approach with XeTeX and
\XeTeXinterchartoks
(i.e. compile the below withxelatex
):You can make the range smaller if you'd like less aggressive miskerning, e.g. changing
{-30}{30}
to{-10}{20}
gives:The idea is simply to insert a random kern between any two characters. For example, if we typed something like:
and so on, we'd have the result from the image above. The above code just does this, with two shortcuts:
\randkern
, using packagerandom
to generate random numbers, and the\dimexpr
primitive introduced in e-TeX).\XeTeXinterchartoks
(documented in the XeTeX reference guide). Setting\XeTeXinterchartoks 0 0
to\randkern
inserts the token\randkern
between any two characters of class 0 (most characters are of class 0 by default). For example, when our text contains the characterL
followed by the charactero
, XeTeX treats it as if you had typed the token\randkern
between them (like typingL\randkern o
).