Adversarial Typography

The focus of this research is on the potential to manipulate typefaces through OpenType Features as a cryptographic tool in LLM communication, enabling humans and machines to interpret different information.

I uploaded a corrupted PDF into an LLM to understand how it analyzes it. First, I modified the font using non-contextual alternates and then tested the file across several different models.

As expected, the results are twofold:

  1. The model uses OCR to read the text. In this case, the human reader and the machine obviously see the same thing.
  2. The model accesses the text underlying the contextual alternates, thereby reading what would have been written had the font remained unmodified.

This raises critical concerns and a series of questions. Is it possible to perform data injection through this method? What kind of dynamics are enabled between humans and machines when they are not perceiving the same information?

It is possible use the OpenType Feature to hidden messages in the text?

By manipulating a typeface through font editors such as Fontra, it is possible to leverage OpenType Features to trigger specific character substitutions where a predefined sequence of letters is replaced by a single, custom glyph. While typographers traditionally use this functionality for automatic ligatures (e.g., the ‘fi’ combination, Unicode U+FB01), this research applies the same logic to create semantic inversion.

By modifying the font’s substitution rules, specific word sequences can be rendered as their opposites: for instance, the string ‘g-o-o-d’ can be mapped to a single glyph visually representing the word ‘bad’. Consequently, while the underlying data remains ‘good’, the visual output displayed to the human reader is ‘bad’, creating a deliberate discrepancy between the encoded text and its visual perception.