# Extending TikZ fadings to the very ends of a character

I'm having a problem with the "custom letter" that I've already asked two questions about. The following MWE illustrates the issue:

\documentclass[border=4]{standalone}
\usepackage{accsupp,xcolor,fontspec,tikz}
\setmainfont{FreeSerif}
\pgfkeys{/SS/xX/thickness/.initial=0.125ex,/SS/xX/thickness/.value required}
\pgfkeys{/SS/xX/shift/.initial={(0ex,0ex)},/SS/xX/shift/.value required}
\pgfkeys{/SS/xX/size/.initial=0.25ex,/SS/xX/size/.value required}
\newcommand*\nulx[1][]{\BeginAccSupp{method=escape,unicode,ActualText={x⃘}}%
\begin{tikzpicture}[outer sep=auto]\pgfqkeys{/SS/xX}{#1}
\node[inner sep=0pt,outer sep=0pt,white,fill=white] (letter) {x};
\draw[line width=\pgfkeysvalueof{/SS/xX/thickness},white,fill=black] (0,0) circle (\pgfkeysvalueof{/SS/xX/size});
\begin{scope}[outer sep=auto]
\draw[line width=\pgfkeysvalueof{/SS/xX/thickness},.] let \p{shift} = \pgfkeysvalueof{/SS/xX/shift} in ($(letter.center) + (\x{shift},\y{shift})$) circle (\pgfkeysvalueof{/SS/xX/size});
\end{scope}
\end{tikzpicture}%
\EndAccSupp{}}
\begin{document}
\textit{x \nulx}
\end{document}


As you can see, the "custom letter" has its ends "cut off," which looks terrible and is generally undesirable. How can I make TikZ recognize the full extent of the letter, rather than just the central portion?

• Is it inner sep=0pt,outer sep=0pt that causes this? – Symbol 1 Dec 29 '15 at 2:48
• This seems to depend on the viewer: Adobe Reader, qpdfview, and Okular show the problem, but mupdf, zathura, apvlv, and atril do not, while xpdf shows only half of the problem. – Thérèse Dec 29 '15 at 2:58
• It seems to me as if x is protruding out of its bounding box on both sides. That is to say, there is nothing you can do about it except from enlarging the clipping box, because the glyph doesn't “know” about shapes outside of its bounding box. – Henri Menke Dec 29 '15 at 9:38
• Here is a picture to show the glyph boundaries. – Henri Menke Dec 29 '15 at 9:44
• @Ptharien'sFlame Replace inner sep by inner xsep and inner ysep , leave inner ysep=0pt and raise inner xsep to your liking. – Henri Menke Dec 29 '15 at 23:13

Replace inner sep by inner xsep and inner ysep, leave inner ysep=0pt and raise inner xsep to your liking.