# Outlined characters

How could I produce characters which are outlined when the character itself is in some color. A picture to illustrate what I'm after:

The problems with the above are that:

• the outline is of no consistent width around the letter.
• the way I've done it (using tikz with a upscaled black node below the colored one), there is no easy way to control the width of the outline.

Do you know of a way to accomplish this with TeX? I am using plain-format with XeTeX, but I'm interested in all ways to accomplish this.

-
Related: tex.stackexchange.com/a/85694/86 –  Andrew Stacey Apr 12 '13 at 14:41
Also related: tex.stackexchange.com/questions/96766/… –  Scott H. Apr 12 '13 at 16:26

The pst-text package can do this.

\documentclass{minimal}
\usepackage{pst-text}
\DeclareFixedFont{\RM}{T1}{ptm}{b}{n}{2cm}

\begin{document}
\pscharpath[fillstyle=solid,fillcolor=magenta!50]{\RM TeXnik}
\end{document}


Perhaps you can migrate this to plain (Xe)TeX.

-
+1 but text-search will be no longer possible. :-) –  xport Aug 8 '11 at 19:22
Since the OP used tikZ this should be no major problem. –  Thorsten Donig Aug 8 '11 at 19:34
I don't get the same output (no color) with the example. –  morbusg Aug 18 '11 at 15:16

The contour package can do this, too. You'll need to use Type 1 fonts (check the documentation); here is sample code

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{pslatex}
\usepackage{contour}
\usepackage{color}
\pagestyle{empty}
\begin{document}
\contourlength{2pt} %how thick each copy is
\contournumber{20}  %number of copies
\contour{red}{\Huge \textcolor{green}{This is the text.}}\\
\end{document}


The output is: Changing the contourlength to 1pt will give a less pronounced outline.

-
Very impressive solution (+1). –  Thorsten Donig Aug 8 '11 at 20:15
I like this solution. Too bad I couldn't get contour to load with eplain. –  morbusg Aug 9 '11 at 15:55
I tried loading eplain with contour and didn't encounter any problems. –  DJP Aug 10 '11 at 0:42
Are you on TL11? Or did you compile with latex? –  morbusg Aug 11 '11 at 4:09
I'm using TL 2009. –  DJP Aug 11 '11 at 4:29
\special{pdf:bcolor [.8 0 .8] [0]} % two arrays: first defines fill, second the stroke.