0

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}
\usetikzlibrary{calc,fadings}
\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}
\begin{tikzfadingfrompicture}[name=x circle fading,outer sep=auto]
\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});
\end{tikzfadingfrompicture}
\begin{scope}[outer sep=auto]
\node[inner sep=0pt,outer sep=0pt,scope fading=x circle fading,fit fading=false,fading transform={shift=\pgfkeysvalueof{/SS/xX/shift}}] (letter) {x};
\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}

A comparison of <code>x</code> and <code>\nulx</code>.

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?

  • 1
    Is it inner sep=0pt,outer sep=0pt that causes this? – Symbol 1 Dec 29 '15 at 2:48
  • 2
    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
  • 2
    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
  • 3
    Here is a picture to show the glyph boundaries. – Henri Menke Dec 29 '15 at 9:44
  • 4
    @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
2

[My comment as an answer]

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.