-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No output with radialshading in RTL context (lualatex) #934
Comments
Is this a regression or does this also happen with older versions of PGF (and older versions of LaTeX)? |
I noticed the issue mid 2019, before that I don't know . |
Quick tests show that both texlive 2019 and 2018 on Overleaf.com give the same, wrong output. |
Remarque: if we add % lualatex
% Notice position of \bodydir TLT with those two cases
\documentclass{article}
\usepackage{tikz}
\usepackage[bidi=basic,nil]{babel}
\babelprovide[import,main]{arabic}
\fboxsep=0pt
\parindent=0pt
\begin{document}
% TRT
\makeatletter
\pgfutil@colorlet{tikz@ball}{red}
\pgfdeclareradialshading[tikz@ball]{ball}{\pgfqpoint{-10bp}{10bp}}{%
color(0bp)=(tikz@ball!15!white);
color(9bp)=(tikz@ball!75!white);
color(18bp)=(tikz@ball!70!black);
color(25bp)=(tikz@ball!50!black);
color(50bp)=(black)}%
\makeatother
{\bodydir TLT
\pgfuseshading{ball}
}
{\bodydir TLT
\pgfdeclareradialshading{sphere}{\pgfpoint{-10bp}{10bp}}{%
color(0bp)=(red!15!white);
color(9bp)=(red!75!white);
color(18bp)=(red!70!black);
color(25bp)=(red!50!black);
color(50bp)=(black)}
}
\pgfuseshading{sphere}
\end{document} |
This work fine % lualatex
\documentclass{article}
\usepackage{tikz}
\usepackage[bidi=basic,nil]{babel}
\babelprovide[import,main]{arabic}
\makeatletter
\def\pgfsys@radialshading#1#2#3{%
{%
\pgf@parsefunc{#3}%
\setbox\pgfutil@tempboxa=\hbox dir TLT to2\pgf@max{\vbox to2\pgf@max{\vfil\pgfsys@invoke{/Sh sh}}\hfil}%
\pgf@process{#2}%
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
\pgf@process{\pgfpoint{\pgf@max}{\pgf@max}}%
\advance\pgf@xa by \pgf@x%
\advance\pgf@ya by \pgf@y%
\pgf@sys@bp@correct{\pgf@x}%
\pgf@sys@bp@correct{\pgf@y}%
\pgf@sys@bp@correct{\pgf@xa}%
\pgf@sys@bp@correct{\pgf@ya}%
\immediate\saveboxresource resources {%
/Shading << /Sh << /ShadingType 3
/ColorSpace \pgf@shading@device\space
/Domain [\pgf@pdfparseddomain]
/Coords [\pgf@sys@tonumber{\pgf@xa} \pgf@sys@tonumber{\pgf@ya} \pgf@doma\space \pgf@sys@tonumber{\pgf@x} \pgf@sys@tonumber{\pgf@y} \pgf@domb]
/Function \pgf@pdfparsedfunction
/Extend [true false] >> >>}\pgfutil@tempboxa% <<
\xdef\pgfutil@tempa{\hbox{\noexpand\useboxresource\the\lastsavedboxresourceindex}}%
}%
\global\expandafter\let\csname @pgfshading#1!\endcsname=\pgfutil@tempa
}%
\makeatother
\begin{document}
% TRT
\makeatletter
\pgfutil@colorlet{tikz@ball}{red}
\pgfdeclareradialshading[tikz@ball]{ball}{\pgfqpoint{-10bp}{10bp}}{%
color(0bp)=(tikz@ball!15!white);
color(9bp)=(tikz@ball!75!white);
color(18bp)=(tikz@ball!70!black);
color(25bp)=(tikz@ball!50!black);
color(50bp)=(black)}%
\makeatother
\pgfuseshading{ball}
\pgfdeclareradialshading{sphere}{\pgfpoint{-10bp}{10bp}}{%
color(0bp)=(red!15!white);
color(9bp)=(red!75!white);
color(18bp)=(red!70!black);
color(25bp)=(red!50!black);
color(50bp)=(black)}
\pgfuseshading{sphere}
\end{document}
|
Thank you very much for finding a fix! |
Brief outline of the bug
In RTL context (lualatex engine)
radialshading
do not produce result (example was taken from tikz manual)Minimal working example (MWE)
The text was updated successfully, but these errors were encountered: