EDIT: My first MWE and question didn't really cover what I want. What I actually want looks like this,
except,
a) I want the outline thickness to remain consistent with what I get from \textpdfrenderand, b) I would love to be able to search and copy-paste text. The \contour package creates the outline by duplicating the text a number of times. That ruins the "text"-ness of the text. I should note that \textpdfrender already exists and works well, if you're using a single colour to fill your text. In my previous question: How to fill text with bands of colour in tikz and keep normal text positioning, I got this solution from mais
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{pgfplots}
\usepackage[outline,pdftex]{contour} % the options make it look better
\usepackage{pdfrender}
\begin{document}
% \TextShadeContour{<number of colors>}{<contour color>}{<text>}
\newcommand{\TextShadeContour}[3]{%
\begin{tikzpicture}[baseline]
\foreach \c in {1,2,...,#1}{
\pgfplotscolormapaccess[1:#1]{\c}{ShadingColor}
\definecolor{colortemp}{rgb}{\pgfmathresult}
\ifnum\c=1
\node[colortemp, anchor=base, inner xsep=0pt, inner ysep=.5pt, outer sep=0pt] (n) at (0,0) {\contour{#2}{#3}};
\else
\pgfmathparse{1-(\c-1)/#1}
\clip let \p1=(n.south west), \p2=(n.north east), in (n.south west) rectangle (\x2,\y1+\pgfmathresult*\y2-\pgfmathresult*\y1);
\node[colortemp, anchor=base, inner xsep=0pt, inner ysep=.5pt, outer sep=0pt] {#3};
\fi
}
\end{tikzpicture}%
}
{\pgfplotsset{colormap={ShadingColor}{color=(pink),color=(orange),color=(green)}} \TextShadeContour{3}{black}{42}: \textpdfrender{
TextRenderingMode=FillStroke,
LineWidth=0.2pt,
LineJoinStyle=1,
FillColor=green,
}{C}\pgfplotsset{colormap={ShadingColor}{color=(pink),color=(orange)}}\TextShadeContour{2}{black}{Ma}
}
\end{document}
I want to be able to essentially use the pdf special somehow (perhaps?) to outline these as does \textpdfrender
EDIT: This was my original MWE which didn't actually describe what I wanted. If you look at the example from http://project.ktug.org/dvipdfmx/doc/tug2005.pdf#page=11, we should have an outline with grey filling the text.
\documentclass{article}
\begin{document}
stuff
\special{pdf:bcolor [.5] [0]}
\special{pdf:literal direct 1 w 2 Tr}
stuff
\end{document}

\pdfextension literal direct {1 w 2 Tr}e.g. Or try the pdfrender package. – Ulrike Fischer Dec 07 '21 at 23:04\pdfextensioncommands and found not much in terms of examples. I want the part of\pdfrenderwhich adds the outline.@David Carlisle: That makes sense. [1] https://tex.stackexchange.com/questions/622920/how-to-fill-text-with-bands-of-colour-in-tikz-and-keep-normal-text-positioning
– keymasta Dec 08 '21 at 18:47