# How to change color of edge of characters? [duplicate]

Possible Duplicate:
Outlined characters

There are many ways how to change whole character color. I want edge color to be different from body color of character. How to do it?

It is possible to make character not from one color? (To make effects like "shadowed" character.)

-

## marked as duplicate by Harish Kumar, Kurt, Werner, clemens, azetinaDec 6 '12 at 3:07

I just found effect trough pstricks or tikz, it could help. –  boucekv Dec 5 '12 at 7:49

You can use the contour package for this. If you load it with the outline option, you'll get "proper" outlines (as opposed to several offset copies of your text).

\documentclass{article}
\usepackage[outline]{contour}
\usepackage{amsmath}

\contourlength{.4pt}
\begin{document}
\textcolor{yellow}{\contour{blue}{Some Words}}
\end{document}

-

Another alternative is package pdfrender:

• It needs pdfTeX or LuaTeX in PDF mode.
• It works for Type 1 fonts by changing their rendering mode, thus PK fonts or rules are not supported.
• Paragraphs, line breaks and even page breaks are supported.
• Works with LaTeX or plain TeX based formats.
• Available both as switch \pdfrender and as macro \textpdfrender similar to \textcolor.

Example file:

\documentclass{article}
\usepackage{pdfrender}
\usepackage{xcolor}

\begin{document}
\textpdfrender{
TextRenderingMode=2,
LineWidth=.05ex,
StrokeColor=blue!30!black,
FillColor=orange!90,
}{Hello World}
\end{document}


-
Oh, that looks interesting! Three questions: 1. Is there a way to put the stroke behind the text (thick strokes will otherwise drown out the fill colour)? 2. It seems that \pdfrender acts as a switch, changing the drawing style for all text that follows. Is there a way to apply the style only to a selected text segment? 3. Do you see a way of applying the pdfrender style to things like fraction lines (see tex.stackexchange.com/questions/8602/…)? –  Jake Dec 5 '12 at 13:47
@Jake (2) Use \textpdfrender instead of \pdfrender... –  Paul Gaborit Dec 5 '12 at 13:48
@Jake Even with \textpdfrender, the effect of clip actions (as TextRenderingMode=7) overflows the given text segment... May be a bug. –  Paul Gaborit Dec 5 '12 at 14:19
@PaulGaborit Thanks, answer fixed. –  Heiko Oberdiek Dec 5 '12 at 14:23
@Jake Ad 1.: You could put the fill variant over the stroke variant. But this looses line and page breaks. Ad 2.: Mistake, fixed, use \textpdfrender. Ad 3.: No, the feature works with glyphs from Type 1 fonts. Other things like rules or PK fonts are not supported. –  Heiko Oberdiek Dec 5 '12 at 14:33

pst-text (part of the pstricks bundle) has some text-manipulation capability, including turning text into paths:

\documentclass{article}
\usepackage{pst-text}% http://ctan.org/pkg/pst-text
\begin{document}
\pscharpath[linecolor=red,linewidth=.4pt,fillstyle=solid,fillcolor=green]{\Large Some text}
\end{document}


More (illustrative) examples are contained within the pst-text documentation.

-

And here comes a ConTeXt example using the effect feature with the outer setting.

\defineeffect
[outline]
[alternative=outer,
rulethickness=3pt]

\starttext

\dontleavehmode
\startcolor [green]%
\hbox to\zeropoint{Hello World!}%
\stopcolor
%
\startcolor [blue]%
\hbox to\zeropoint{%
\starteffect [outline]%
Hello World!
\stopeffect}%
\stopcolor

\stoptext


-