Obfuscation of @ and . in e-mail addresses

To provide PDF files containing the dot and the at in the right font, put this in at.tex

\documentclass{standalone}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\begin{document}
@
\end{document}

and likewise this in dot.tex

\documentclass{standalone}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\begin{document}
.
\end{document}

Edit: This solution was actually wrong as I first wrote it. I assumed you can just use the generated PDFs as a neutral vector graphic. You can't; the mail addresses are still easily copy-and-pasted. You can, however, use some software like inkscape to convert the text to a "real" vector graphic and save it as a PDF again. You can then proceed as before. [End of Edit]

\documentclass[a5paper]{article}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\newcommand{\crazyat}{\includegraphics[width=.9em]{at}}
\newcommand{\crazydot}{\includegraphics[width=.25em]{dot}}
\begin{document}
\noindent [email protected]\\
foobar\crazyat{}example\crazydot{}com\\
\Large [email protected]\\
foobar\crazyat{}example\crazydot{}com
\end{document}

Which looks good to my eye:

comparison between obfuscated and normal mail address


The letters can be exported in the font editor FontForge as SVG graphics. Then, the paths descriptions in the SVG files (attribute d in element path) can be used to fill the path in TikZ.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{svg.path}

\newcommand*{\svgat}{%
  \leavevmode
  \tikz[baseline=0pt, x=1pt, y=1pt, scale=1em/1000]\fill
    svg {
      M588 457v-241c0 -15 0 -66 35 -66c66 0 73 90 73 182c0 241 -171 351 -308
      351c-164 0 -307 -145 -307 -336c0 -179 130 -336 312 -336c94 0 187 24
      272 64c5 3 7 3 23 3h9c16 0 23 0 23 -10c0 -16 -120 -51 -146 -57c-64 -15
      -128 -22 -180 -22 c-200 0 -338 170 -338 358c0 199 150 358 333 358c161
      0 332 -133 332 -367c0 -107 -14 -210 -102 -210c-38 0 -90 19 -100 71c-30
      -42 -78 -71 -132 -71c-103 0 -198 93 -198 219s95 219 198 219c39 0 91
      -14 137 -77c6 -7 7 -8 23 -8h17c23 0 24 -1 24 -24zM519 262v170 c0 18 0
      21 -13 40c-36 56 -84 72 -116 72c-73 0 -132 -86 -132 -197s60 -197 132
      -197c20 0 71 6 115 69c14 21 14 25 14 43z
    }
    (current bounding box.west) ++(-56, 0) % left side bearing
    (current bounding box.east) ++(56, 0) % right side bearing
  ;%
}

\newcommand*{\svgperiod}{%
  \leavevmode
  \tikz[baseline=0pt, x=1pt, y=1pt, scale=1em/1000]\fill
    svg {
      M192 53c0 -29 -24 -53 -53 -53s-53 24 -53 53s24 53 53 53s53 -24 53 -53z
    }
    (current bounding box.west) ++(-86, 0) % left side bearing
    (current bounding box.east) ++(85, 0) % right side bearing
  ;%
}

\begin{document}
  [email protected]

  john\svgperiod doe\svgat example\svgperiod org

  {\Large john\svgperiod doe\svgat example\svgperiod org}

  {\scriptsize john\svgperiod doe\svgat example\svgperiod org}
\end{document}

Result

Copy does not see the letters drawn by TikZ. The selected email addresses in evince:

Selected

Remarks:

  • The SVG paths are taken from font file "cmr10.pfb".

  • If TeX switches fonts in different font sizes, here "cmr12.pfb" for \Large and cmr5.pfb for \scriptsize, then different macros could be defined to get the perfect glyphs for the size. But for this purpose, a scaled normal size version should do. The scaling is done automatically, because option scale depends on the current size of unit em.

  • Library svg.paths uses 1pt as unit, therefore the TikZ glyphs are scaled to the correct size by scale. The font uses 1000 glyph units for 1em. The TFM file for cmr10 keeps the width of 1em: QUAD R 1.000003 (small rounding glitch). Therefore, the scale factor is 1em/1000.

  • The values for the side bearings are taken from the glyph views in FontForge.

  • Of course, the letter obfuscating can be circumvented by using OCR.