texlive[70935] Master/texmf-dist: fancyqr (13apr24)
commits+karl at tug.org
commits+karl at tug.org
Sat Apr 13 22:33:41 CEST 2024
Revision: 70935
https://tug.org/svn/texlive?view=revision&revision=70935
Author: karl
Date: 2024-04-13 22:33:40 +0200 (Sat, 13 Apr 2024)
Log Message:
-----------
fancyqr (13apr24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/fancyqr/README.md
trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.pdf
trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.tex
trunk/Master/texmf-dist/doc/latex/fancyqr/qr-example.tex
trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-blobs.code
trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-dots.code
trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-flat.code
trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-frame.code
trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-glitch.code
trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-swift.code
trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr.sty
Modified: trunk/Master/texmf-dist/doc/latex/fancyqr/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fancyqr/README.md 2024-04-13 09:06:50 UTC (rev 70934)
+++ trunk/Master/texmf-dist/doc/latex/fancyqr/README.md 2024-04-13 20:33:40 UTC (rev 70935)
@@ -1,16 +1,16 @@
# fancyqr
-[](https://www.latex-project.org/) [](https://opensource.org/licenses/GPL-3.0) [](http://makeapullrequest.com) [](https://github.com/EagleoutIce/fancyqr/actions/workflows/compile.yaml)
+[](https://www.latex-project.org/) [](https://opensource.org/licenses/GPL-3.0) [](http://makeapullrequest.com) [](https://www.ctan.org/pkg/fancyqr) [](https://github.com/EagleoutIce/fancyqr/actions/workflows/compile.yaml)
[<img src="https://github.com/EagleoutIce/fancyqr/blob/gh-pages/preview-1.png?raw=true" width="600"/>](qr-example.tex)
-Simple package to create fancy qr-codes with the help of the [`qrcode`](https://www.ctan.org/pkg/qrcode)-package.
-You may use `\fancyqr` just like the normal `\qrcode` (`\fancyqr[<qr-options>]{<url>}`). See the [documentation](https://media.githubusercontent.com/media/EagleoutIce/fancyqr/blob/gh-pages/build/fancyqr-doc.pdf).
+A simple package to create fancy qr-codes with the help of the [`qrcode`][qrcode]-package.
+You may use `\fancyqr` just like the normal `\qrcode` (`\fancyqr[<qr-options>]{<url>}`). See the [documentation](https://media.githubusercontent.com/media/EagleoutIce/fancyqr/gh-pages/build/fancyqr-doc.pdf).
-*fancyqr* is actively developed by *Florian Sihler* (contact me at: <florian.sihler at uni-ulm.de>) under the [GPLv3 License](LICENSE). I am very happy about every contribution (see [CONTRIBUTING.md](CONTRIBUTING.md)).
+*fancyqr* is actively developed by *Florian Sihler* (contact me at: <florian.sihler at uni-ulm.de>) under the [GPLv3 License](LICENSE). I am very happy about every contribution (see [CONTRIBUTING.md](CONTRIBUTING.md)). You can find it on CTAN (<https://www.ctan.org/pkg/fancyqr>).
-If you do want to hide a center square (e.g, because you want to embed an image) you can use `\FancyQrDoNotPrintSquare{<x>}{<y>}` to hide a rectangle with radius x and y set from the center. If you choose this option, the default `\FancyQrRoundCut` that rounds cut corners can be changed with `\FancyQrHardCut`.
-At the moment, there are six other styles `flat`, `frame`, `blob`, `glitch`, `swift`, and `dots`, that you can load (locally) by using `\FancyQrLoad{<name>}`. The default style is named `default` and can be 'reset' by `\FancyQrLoad{default}` or `\FancyLoadDefault`.
+If you do want to hide a center square (e.g., because you want to embed an image), you can use `\FancyQrDoNotPrintSquare{<x>}{<y>}` to hide a rectangle with radius x and y set from the center. If you choose this option, the default `\FancyQrRoundCut` that rounds cut corners can be changed with `\FancyQrHardCut`.
+At the moment, there are six other styles (`flat`, `frame`, `blobs`, `glitch`, and `dots`) that you can load (locally) by using `\FancyQrLoad{<name>}`. The default style is named `default` and can be 'reset' by `\FancyQrLoad{default}` or `\FancyQrLoadDefault`.
There are the following extra qr-options (you can set all of them with `\fancyqrset{<keys>}`):
| Option | Type | Default | Explanation |
@@ -26,6 +26,9 @@
| `r color` | color | `teal` | Set the bottom right gradient color. |
| `right color` | color | | Alias for `r color`. |
| `gradient angle` | angle | `135` | Change the gradient angle. |
+| `random color` | colors | | Allow to set a random color pool to pick from. |
+| `width` | length | | Alias for [`qrcode`'s][qrcode] `height` option. |
+| `size` | length | | Alias for [`qrcode`'s][qrcode] `height` option. |
The defaults are set like this:
@@ -33,4 +36,6 @@
\fancyqrset{image padding=0,gradient=true,gradient angle=135,r color=teal,l color=purple}
```
-[^1]: The package will automatically calculate the required `\FancyQrDoNotPrintSquare` (you have to make sure the, the qr code still has enough information to be readable). Therefore, the image will not scale with the qr code.
+[^1]: The package will automatically calculate the required `\FancyQrDoNotPrintSquare` (you have to ensure that the qr-code still has enough information to be readable). Therefore, the image will not scale with the qr-code.
+
+[qrcode]: https://www.ctan.org/pkg/qrcode
Modified: trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.tex 2024-04-13 09:06:50 UTC (rev 70934)
+++ trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.tex 2024-04-13 20:33:40 UTC (rev 70935)
@@ -1,4 +1,4 @@
-% Florian Sihler, 2022
+% Florian Sihler, 2024
% Licensed under GNU General Public License version 3
% https://opensource.org/licenses/gpl-3.0.html
\documentclass[parskip=half,english,numbers=noenddot,footnotes=nomultiple,oneside]{scrartcl}
@@ -21,7 +21,7 @@
\lstdefinelanguage{ltx}{
language={[LaTeX]TeX},
- moretexcs=[1]{fancyqr,qrcode,FancyQrDoNotPrintSquare,FancyQrRoundCut,FancyQrHardCut,FancyQrLoad,FancyLoadDefault,fancyqrset,faGithub}
+ moretexcs=[1]{fancyqr,qrcode,FancyQrDoNotPrintSquare,FancyQrRoundCut,FancyQrHardCut,FancyQrLoad,FancyQrLoadDefault,fancyqrset,faGithub}
}
\lstset{basicstyle=\ttfamily,breaklines,texcsstyle=*\color{purple}\bfseries,language=ltx}
\lstMakeShortInline|
@@ -34,7 +34,7 @@
\texorpdfstring{Florian Sihler\medskip\\*
\fancyqr{https://github.com/EagleoutIce/fancyqr}
}{Florian Sihler}}
-\date{Version v1.1 \textendash{} 2022/08/19}
+\date{Version v2.0 \textendash{} 2024/04/13}
\begin{document}
@@ -45,7 +45,7 @@
You can use the |\fancyqr|-macro just like the normal |\qrcode|.\footnote{\ltx{\\fancyqr[<qr-options>]\{<url>\}}}
If you do want to hide a center square (e.g, because you want to embed an image) you can use |\FancyQrDoNotPrintSquare{<x>}{<y>}| to hide a rectangle with radius x and y set from the center. If you choose this option, the default |\FancyQrRoundCut| that rounds cut corners can be changed with |\FancyQrHardCut|.
- At the moment, there are six other styles for the qr-code |flat|, |frame|, |blob|, |glitch|, |swift|, and |dots|, that you can load (locally) by using |\FancyQrLoad{<name>}|. The default style is named |default| and can be 'reset' by |\FancyQrLoad{default}| or |\FancyLoadDefault|.
+ At the moment, there are six other styles for the qr-code |flat|, |frame|, |blobs|, |glitch|, and |dots|, that you can load (locally) by using |\FancyQrLoad{<name>}|. The default style is named |default| and can be 'reset' by |\FancyQrLoad{default}| or |\FancyQrLoadDefault|.
All of the extra qr-options (you can set all of them with |\fancyqrset{<keys>}|) are showcased in \autoref{tbl:extra-keys}.
The defaults are set like this:
@@ -60,28 +60,31 @@
\parbox[c]{.3\linewidth}{Which produces:}\hfill\parbox[c]{.4\linewidth}{\raggedleft\fancyqr[image=\Huge\faGithub,image padding=1,color=black!90!gray]{https://github.com/EagleoutIce/fancyqr}}\par
- \begin{savenotes}
- \begin{table}
- \centering\begin{tabular}{>{\ttfamily}ll>{\ttfamily}cp{.5\linewidth}}
- \toprule
- \multicolumn{1}{l}{Option} & Type & \multicolumn{1}{c}{Default} & Explanation \\
- \midrule
- image & \LaTeX & & Automatically center an image.\footnote{The package will automatically calculate the required \ltx{\\FancyQrDoNotPrintSquare} (you have to make sure that the qr code still has enough information to be readable). Therefore, the image will not scale with the qr code.} \\
- image padding & number & & Additionally hide blocks (x \& y) around the image. \\
- image x padding & number & 0 & Additionally hide blocks (x) around the image. \\
- image y padding & number & 0 & Additionally hide blocks (y) around the image. \\
- gradient & boolean & true & Toggle the color gradient \\
- color & color & & Disables the |gradient| and sets the color accordingly. \\
- l color & color & purple & Set the top left gradient color. \\
- left color & color & & Alias for |l color|. \\
- r color & color & teal & Set the bottom right gradient color. \\
- right color & color & & Alias for |r color|. \\
- gradient angle & angle & 135 & Change the gradient angle. \\
- \bottomrule
- \end{tabular}
- \caption{Overview of special qr-options.}
- \label{tbl:extra-keys}
- \end{table}
- \end{savenotes}
+\begin{savenotes}
+\begin{table}
+ \centering\begin{tabular}{>{\ttfamily}ll>{\ttfamily}cp{.5\linewidth}}
+ \toprule
+ \multicolumn{1}{l}{Option} & Type & \multicolumn{1}{c}{Default} & Explanation \\
+ \midrule
+ image & \LaTeX & & Automatically center an image.\footnote{The package will automatically calculate the required \ltx{\\FancyQrDoNotPrintSquare} (you have to make sure that the qr code still has enough information to be readable). Therefore, the image will not scale with the qr code.} \\
+ image padding & number & & Additionally hide blocks (x \& y) around the image. \\
+ image x padding & number & 0 & Additionally hide blocks (x) around the image. \\
+ image y padding & number & 0 & Additionally hide blocks (y) around the image. \\
+ gradient & boolean & true & Toggle the color gradient \\
+ color & color & & Disables the |gradient| and sets the color accordingly. \\
+ l color & color & purple & Set the top left gradient color. \\
+ left color & color & & Alias for |l color|. \\
+ r color & color & teal & Set the bottom right gradient color. \\
+ right color & color & & Alias for |r color|. \\
+ gradient angle & angle & 135 & Change the gradient angle. \\
+ random color & colors & & Allow to set a random color pool to pick from. \\
+ width & length & & Alias for |qrcode|'s |height| option. \\
+ size & length & & Alias for |qrcode|'s |height| option. \\
+ \bottomrule
+ \end{tabular}
+ \caption{Overview of special qr-options.}
+ \label{tbl:extra-keys}
+\end{table}
+\end{savenotes}
\end{document}
Modified: trunk/Master/texmf-dist/doc/latex/fancyqr/qr-example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fancyqr/qr-example.tex 2024-04-13 09:06:50 UTC (rev 70934)
+++ trunk/Master/texmf-dist/doc/latex/fancyqr/qr-example.tex 2024-04-13 20:33:40 UTC (rev 70935)
@@ -1,25 +1,33 @@
-% Florian Sihler, 2022
+% Florian Sihler, 2024
% Licensed under GNU General Public License version 3
% https://opensource.org/licenses/gpl-3.0.html
\documentclass{article}
\usepackage{fontawesome}
-
\usepackage{fancyqr}
+% for showcase of random colors
+\usepackage{pgfmath}
+\usepackage[prefix=@]{xcolor-material}
+
+% to showcase scalebox
+\usepackage{graphicx}
+
\usepackage[active,tightpage]{preview} % for presentation
\setlength\PreviewBorder{15pt}
-\fancyqrset{height=3.25cm,level=H,padding}
+\fancyqrset{size=3.25cm,level=H,padding}
\begin{document}
\preview
% \FancyQrDoNotPrintSquare{8}{9}
% \FancyQrHardCut
-\mbox{\FancyQrLoad{blobs}
-\fancyqr[image=\scalebox{2.9}{\faGithub\kern1pt},image padding=1,color=black!90!gray]{https://github.com/EagleoutIce/fancyqr}
-\FancyQrLoad{default}
-\fancyqr{https://github.com/EagleoutIce/fancyqr}
-\FancyQrLoad{dots}\fancyqr[image={\tikz\node[align=center,draw]{\huge Ha\\Huhu};},r color=gray,gradient angle=45]{https://github.com/EagleoutIce/fancyqr}}%
+\mbox{\FancyQrLoad{blobs}%
+\fancyqr[image=\scalebox{2.9}{\faGithub},image padding=1,color=black!90!gray]{https://github.com/EagleoutIce/fancyqr}%
+\FancyQrLoad{default}%
+\fancyqr{https://github.com/EagleoutIce/fancyqr}%
+\FancyQrLoad{dots}%
+\fancyqr[image={\textsf{\textbf{\textcolor{gray}{fancy}qr}}}, random color={@Red}{@Pink}{@Purple}{@DeepPurple}{@Indigo}{@Blue}{@Cyan}{@Teal}{@Green}{@Amber}{@Orange}{@DeepOrange}{@Brown}]{https://github.com/EagleoutIce/fancyqr}%
+}%
\endpreview
\end{document}
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-blobs.code
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-blobs.code 2024-04-13 09:06:50 UTC (rev 70934)
+++ trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-blobs.code 2024-04-13 20:33:40 UTC (rev 70935)
@@ -1,23 +1,36 @@
-\def\@tikz at fancy@qr at blobb{[rounded corners=.08*\qrm] (0,0) +(0:.3*\qrm+.515*\qrm*rnd) foreach \a in {30,60,...,360} {-- +(\a:.3*\qrm+.515*\qrm*rnd)} -- cycle}%
+% with pict2e and polar coordinate translation
+\def\@fancy at qr@blobb{%
+\@tempcnta=\z@
+\roundjoin
+\roundcap
+\moveto(0,0)
+\loop
+\advance\@tempcnta by 30
+\edef\rad{\fpeval{.2*\qr at modulesize+.115*\qr at modulesize*abs(rand())}}% fixed rand for both
+\lineto(\fpeval{cos(\@tempcnta)*\rad},\fpeval{sin(\@tempcnta)*\rad})
+\ifnum\@tempcnta<360\relax
+\repeat
+\fillpath
+}%
% .
-\newpattern0000{\@tikz at fancy@qr at blobb}%
+\newpattern0000{\@fancy at qr@blobb}%
% | | - -
-\newpattern1000{\@tikz at fancy@qr at blobb}%
-\newpattern0001{\@tikz at fancy@qr at blobb}%
-\newpattern0100{\@tikz at fancy@qr at blobb}%
-\newpattern0010{\@tikz at fancy@qr at blobb}%
+\newpattern1000{\@fancy at qr@blobb}%
+\newpattern0001{\@fancy at qr@blobb}%
+\newpattern0100{\@fancy at qr@blobb}%
+\newpattern0010{\@fancy at qr@blobb}%
% corners
-\newpattern1100{\@tikz at fancy@qr at blobb}%
-\newpattern1010{\@tikz at fancy@qr at blobb}%
-\newpattern0101{\@tikz at fancy@qr at blobb}%
-\newpattern0011{\@tikz at fancy@qr at blobb}%
+\newpattern1100{\@fancy at qr@blobb}%
+\newpattern1010{\@fancy at qr@blobb}%
+\newpattern0101{\@fancy at qr@blobb}%
+\newpattern0011{\@fancy at qr@blobb}%
% straights | --
-\newpattern1001{\@tikz at fancy@qr at blobb}%
-\newpattern0110{\@tikz at fancy@qr at blobb}%
+\newpattern1001{\@fancy at qr@blobb}%
+\newpattern0110{\@fancy at qr@blobb}%
% enclosed
-\newpattern1111{\@tikz at fancy@qr at blobb}%
+\newpattern1111{\@fancy at qr@blobb}%
% t's
-\newpattern0111{\@tikz at fancy@qr at blobb}%
-\newpattern1011{\@tikz at fancy@qr at blobb}%
-\newpattern1101{\@tikz at fancy@qr at blobb}%
-\newpattern1110{\@tikz at fancy@qr at blobb}%
\ No newline at end of file
+\newpattern0111{\@fancy at qr@blobb}%
+\newpattern1011{\@fancy at qr@blobb}%
+\newpattern1101{\@fancy at qr@blobb}%
+\newpattern1110{\@fancy at qr@blobb}%
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-dots.code
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-dots.code 2024-04-13 09:06:50 UTC (rev 70934)
+++ trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-dots.code 2024-04-13 20:33:40 UTC (rev 70935)
@@ -1,22 +1,23 @@
+\def\fancyqr at dots@circle{\put(.5,.5){\circle*{\@ne}}}
% .
-\newpattern0000{(0,0)circle[radius=.475*\qrm]}%
+\newpattern0000{\fancyqr at dots@circle}%
% | | - -
-\newpattern1000{(0,0)circle[radius=.475*\qrm]}%
-\newpattern0001{(0,0)circle[radius=.475*\qrm]}%
-\newpattern0100{(0,0)circle[radius=.475*\qrm]}%
-\newpattern0010{(0,0)circle[radius=.475*\qrm]}%
+\newpattern1000{\fancyqr at dots@circle}%
+\newpattern0001{\fancyqr at dots@circle}%
+\newpattern0100{\fancyqr at dots@circle}%
+\newpattern0010{\fancyqr at dots@circle}%
% corners
-\newpattern1100{(0,0)circle[radius=.475*\qrm]}%
-\newpattern1010{(0,0)circle[radius=.475*\qrm]}%
-\newpattern0101{(0,0)circle[radius=.475*\qrm]}%
-\newpattern0011{(0,0)circle[radius=.475*\qrm]}%
+\newpattern1100{\fancyqr at dots@circle}%
+\newpattern1010{\fancyqr at dots@circle}%
+\newpattern0101{\fancyqr at dots@circle}%
+\newpattern0011{\fancyqr at dots@circle}%
% straights | --
-\newpattern1001{(0,0)circle[radius=.475*\qrm]}%
-\newpattern0110{(0,0)circle[radius=.475*\qrm]}%
+\newpattern1001{\fancyqr at dots@circle}%
+\newpattern0110{\fancyqr at dots@circle}%
% enclosed
-\newpattern1111{(0,0)circle[radius=.475*\qrm]}%
+\newpattern1111{\fancyqr at dots@circle}%
% t's
-\newpattern0111{(0,0)circle[radius=.475*\qrm]}%
-\newpattern1011{(0,0)circle[radius=.475*\qrm]}%
-\newpattern1101{(0,0)circle[radius=.475*\qrm]}%
-\newpattern1110{(0,0)circle[radius=.475*\qrm]}%
\ No newline at end of file
+\newpattern0111{\fancyqr at dots@circle}%
+\newpattern1011{\fancyqr at dots@circle}%
+\newpattern1101{\fancyqr at dots@circle}%
+\newpattern1110{\fancyqr at dots@circle}%
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-flat.code
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-flat.code 2024-04-13 09:06:50 UTC (rev 70934)
+++ trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-flat.code 2024-04-13 20:33:40 UTC (rev 70935)
@@ -1,22 +1,23 @@
+\def\fancyqr at flat@rect{\moveto(0,0)\lineto(0,1)\lineto(1,1)\lineto(1,0)\lineto(0,0)\fillpath}
% .
-\newpattern0000{(0,0)rectangle(\qrm,\qrm)}%
+\newpattern0000{\fancyqr at flat@rect}%
% | | - -
-\newpattern1000{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern0001{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern0100{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern0010{(0,0)rectangle(\qrm,\qrm)}%
+\newpattern1000{\fancyqr at flat@rect}%
+\newpattern0001{\fancyqr at flat@rect}%
+\newpattern0100{\fancyqr at flat@rect}%
+\newpattern0010{\fancyqr at flat@rect}%
% corners
-\newpattern1100{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern1010{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern0101{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern0011{(0,0)rectangle(\qrm,\qrm)}%
+\newpattern1100{\fancyqr at flat@rect}%
+\newpattern1010{\fancyqr at flat@rect}%
+\newpattern0101{\fancyqr at flat@rect}%
+\newpattern0011{\fancyqr at flat@rect}%
% straights | --
-\newpattern1001{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern0110{(0,0)rectangle(\qrm,\qrm)}%
+\newpattern1001{\fancyqr at flat@rect}%
+\newpattern0110{\fancyqr at flat@rect}%
% enclosed
-\newpattern1111{(0,0)rectangle(\qrm,\qrm)}%
+\newpattern1111{\fancyqr at flat@rect}%
% t's
-\newpattern0111{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern1011{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern1101{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern1110{(0,0)rectangle(\qrm,\qrm)}%
\ No newline at end of file
+\newpattern0111{\fancyqr at flat@rect}%
+\newpattern1011{\fancyqr at flat@rect}%
+\newpattern1101{\fancyqr at flat@rect}%
+\newpattern1110{\fancyqr at flat@rect}%
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-frame.code
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-frame.code 2024-04-13 09:06:50 UTC (rev 70934)
+++ trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-frame.code 2024-04-13 20:33:40 UTC (rev 70935)
@@ -1,25 +1,2 @@
-\tikzset{qrrd/.style={draw,line width=1.25pt}}
-\def\qrframesuffix{; \path[fill,qrrc,fill opacity=.995] (-.1pt,-.1pt) rectangle (\qrm+.1pt,\qrm+.1pt)}
-\def\qrfillring{circle[radius=.625pt]}
-% .
-\newpattern0000{[qrrc](0,0)rectangle(\qrm,\qrm); \path[fill,fill opacity=.965] (\qrm/2,\qrm/2) circle[radius=\qrm/3]}
-% | | - -
-\newpattern1000{(0,\qrm)[qrrc] -- (0,0) -- (\qrm,0) -- (\qrm,\qrm)\qrframesuffix}
-\newpattern0001{(0,0)[qrrc] -- (0,\qrm) -- (\qrm,\qrm) -- (\qrm,0)\qrframesuffix}
-\newpattern0100{(0,0)[qrrc] -- (\qrm,0) -- (\qrm,\qrm) -- (0,\qrm)\qrframesuffix}
-\newpattern0010{(\qrm,0)[qrrc] -- (0,0) -- (0,\qrm) -- (\qrm,\qrm)\qrframesuffix}
-% corners; the good injections to cover loose lines
-\newpattern1100{(\qrm,\qrm)[qrrc] -- (\qrm,0) -- (0,0); \path[fill] (0,\qrm) \qrfillring\qrframesuffix}% top left
-\newpattern1010{(0,\qrm)[qrrc] -- (0,0) -- (\qrm,0); \path[fill] (\qrm,\qrm) \qrfillring\qrframesuffix}% top right
-\newpattern0101{(0,\qrm)[qrrc] -- (\qrm,\qrm) -- (\qrm,0); \path[fill] (0,0) \qrfillring\qrframesuffix}% bottom left
-\newpattern0011{(\qrm,\qrm)[qrrc] -- (0,\qrm) -- (0,0) (\qrm,0); \path[fill] (\qrm,0) \qrfillring\qrframesuffix}% bottom right
-% straights | --
-\newpattern1001{(0,0)--(0,\qrm) (\qrm,0)--(\qrm,\qrm)\qrframesuffix}
-\newpattern0110{(0,0)--(\qrm,0) (0,\qrm)--(\qrm,\qrm)\qrframesuffix}
-% enclosed
-\newpattern1111{; \path[fill] (0,0) \qrfillring; \path[fill] (0,\qrm) \qrfillring; \path[fill] (\qrm,0) \qrfillring; \path[fill] (\qrm,\qrm) \qrfillring\qrframesuffix}
-% t's
-\newpattern0111{(0,\qrm)--(\qrm,\qrm); \path[fill] (0,0) \qrfillring; \path[fill] (\qrm,0) \qrfillring\qrframesuffix} % -,-
-\newpattern1011{(0,\qrm)--(0,0); \path[fill] (\qrm,0) \qrfillring; \path[fill] (\qrm,\qrm)\qrfillring\qrframesuffix}
-\newpattern1101{(\qrm,\qrm)--(\qrm,0); \path[fill] (0,0) \qrfillring; \path[fill] (0,\qrm)\qrfillring\qrframesuffix}
-\newpattern1110{(0,0)--(\qrm,0); \path[fill] (0,\qrm) \qrfillring; \path[fill] (\qrm,\qrm) \qrfillring\qrframesuffix} % -'-
\ No newline at end of file
+\def\fancyqr at rounded@rect at close{\linethickness{.1\qr at modulesize}\closepath\strokepath}%
+\FancyQrLoadDefault
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-glitch.code
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-glitch.code 2024-04-13 09:06:50 UTC (rev 70934)
+++ trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-glitch.code 2024-04-13 20:33:40 UTC (rev 70935)
@@ -1,23 +1,35 @@
-\def\@tikz at fancy@qr at blobb{[qrrc] (0,0) +(0:.35*\qrm+.25*\qrm*rnd) foreach \a in {20,40,...,359} {-- +(\a:.35*\qrm+.2*\qrm*rnd)} -- cycle}%
+\def\@fancy at qr@blobb{%
+\@tempcnta=\z@
+\roundjoin
+\roundcap
+\moveto(0,0)
+\loop
+\advance\@tempcnta by 40
+\def\rad{\fpeval{.2*\qr at modulesize+.115*\qr at modulesize*rand()}}% allow to 'glitch'
+\lineto(\fpeval{cos(\@tempcnta)*\rad},\fpeval{sin(\@tempcnta)*\rad})
+\ifnum\@tempcnta<360\relax
+\repeat
+\fillpath
+}%
% .
-\newpattern0000{\@tikz at fancy@qr at blobb}%
+\newpattern0000{\@fancy at qr@blobb}%
% | | - -
-\newpattern1000{\@tikz at fancy@qr at blobb}%
-\newpattern0001{\@tikz at fancy@qr at blobb}%
-\newpattern0100{\@tikz at fancy@qr at blobb}%
-\newpattern0010{\@tikz at fancy@qr at blobb}%
+\newpattern1000{\@fancy at qr@blobb}%
+\newpattern0001{\@fancy at qr@blobb}%
+\newpattern0100{\@fancy at qr@blobb}%
+\newpattern0010{\@fancy at qr@blobb}%
% corners
-\newpattern1100{\@tikz at fancy@qr at blobb}%
-\newpattern1010{\@tikz at fancy@qr at blobb}%
-\newpattern0101{\@tikz at fancy@qr at blobb}%
-\newpattern0011{\@tikz at fancy@qr at blobb}%
+\newpattern1100{\@fancy at qr@blobb}%
+\newpattern1010{\@fancy at qr@blobb}%
+\newpattern0101{\@fancy at qr@blobb}%
+\newpattern0011{\@fancy at qr@blobb}%
% straights | --
-\newpattern1001{\@tikz at fancy@qr at blobb}%
-\newpattern0110{\@tikz at fancy@qr at blobb}%
+\newpattern1001{\@fancy at qr@blobb}%
+\newpattern0110{\@fancy at qr@blobb}%
% enclosed
-\newpattern1111{\@tikz at fancy@qr at blobb}%
+\newpattern1111{\@fancy at qr@blobb}%
% t's
-\newpattern0111{\@tikz at fancy@qr at blobb}%
-\newpattern1011{\@tikz at fancy@qr at blobb}%
-\newpattern1101{\@tikz at fancy@qr at blobb}%
-\newpattern1110{\@tikz at fancy@qr at blobb}%
\ No newline at end of file
+\newpattern0111{\@fancy at qr@blobb}%
+\newpattern1011{\@fancy at qr@blobb}%
+\newpattern1101{\@fancy at qr@blobb}%
+\newpattern1110{\@fancy at qr@blobb}%
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-swift.code
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-swift.code 2024-04-13 09:06:50 UTC (rev 70934)
+++ trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-swift.code 2024-04-13 20:33:40 UTC (rev 70935)
@@ -1,24 +1,2 @@
-\def\fancy at qrbound{;\pgfresetboundingbox\path(0,0)rectangle(\qrm,\qrm)}%
-% note: the expansion with two seems to be problematic, therefore i use cordinate
-% .
-\newpattern0000{(.5*\qrm,1.1*\qrm)coordinate(@)(1.1*\qrm,.5*\qrm)coordinate(@b)(.5*\qrm,-.1*\qrm)coordinate(@c)(-.1*\qrm,.5*\qrm)coordinate(@d)to[bend right=15](@)to[bend right=15](@b)to[bend right=15](@c)to[bend right=15](@d)\fancy at qrbound}%
-% | | - -
-\newpattern1000{(.5*\qrm,-.1*\qrm)coordinate(@)(0,.2*\qrm)coordinate(@b)|-(\qrm,\qrm)--(\qrm,.2*\qrm)to[out=181,in=65](@)to[out=115,in=1](@b)}%
-\newpattern0001{(.5*\qrm,1.1*\qrm)coordinate(@)(0,.8*\qrm)coordinate(@b)|-(\qrm,0)--(\qrm,.8*\qrm)to[out=179,in=290](@)to[out=250,in=1](@b)}%
-\newpattern0100{(1.1*\qrm,.5*\qrm)coordinate(@)(.8*\qrm,\qrm)coordinate(@b)-|(0,0)--(.8*\qrm,0)to[out=89,in=205](@)to[out=155,in=271](@b)}%
-\newpattern0010{(-.1*\qrm,.5*\qrm)coordinate(@)(.2*\qrm,\qrm)coordinate(@b)-|(\qrm,0)--(.2*\qrm,0)to[out=91,in=335](@)to[out=25,in=269](@b)}%
-% corners
-\newpattern1100{(1.1*\qrm,-.1*\qrm)coordinate(@)(\qrm,\qrm)to[out=271,in=105](@)to[out=155,in=-1](0,0)--(0,\qrm)--(\qrm,\qrm)\fancy at qrbound}%
-\newpattern1010{(-.1*\qrm,-.1*\qrm)coordinate(@)(\qrm,0)coordinate(@b)(0,\qrm)to[out=269,in=75](@)to[out=25,in=181](@b)--(\qrm,\qrm)--(0,\qrm)\fancy at qrbound}%
-\newpattern0101{(\qrm+.1*\qrm,\qrm+.1*\qrm)coordinate(@)(0,\qrm)coordinate(@b)(@b) |- (\qrm,0) to[out=89,in=255](@)to[out=205,in=1](@b)\fancy at qrbound}%
-\newpattern0011{(-.1*\qrm,\qrm+.1*\qrm)coordinate(@)(0,0)coordinate(@b)(@b) -| (\qrm,\qrm) to[out=179,in=335](@)to[out=285,in=91](@b)\fancy at qrbound}%
-% straights | --
-\newpattern1001{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern0110{(0,0)rectangle(\qrm,\qrm)}%
-% enclosed
-\newpattern1111{(0,0)rectangle(\qrm,\qrm)}%
-% t's
-\newpattern0111{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern1011{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern1101{(0,0)rectangle(\qrm,\qrm)}%
-\newpattern1110{(0,0)rectangle(\qrm,\qrm)}%
\ No newline at end of file
+\PackageWarning{fancyqr}{Currently, swift is not supported :/}
+\FancyQrLoadDefault
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr.sty 2024-04-13 09:06:50 UTC (rev 70934)
+++ trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr.sty 2024-04-13 20:33:40 UTC (rev 70935)
@@ -1,22 +1,30 @@
-% Florian Sihler, 2022
+% Florian Sihler, 2024
% Licensed under GNU General Public License version 3
% https://opensource.org/licenses/gpl-3.0.html
\def\filename{fancyqr}
-\ProvidesPackage{\filename}[2022/08/19 version v1.1 Fancy QR-Codes]
-\RequirePackage{tikz, qrcode}
+\ProvidesPackage{\filename}[2024/04/13 version v2.0 Fancy QR-Codes]
+\RequirePackage{pict2e, xfp, qrcode}
% element
% x: {\the\j}; y: {\the\i} | \@max at x \@max at y
-\def\FancyQrColor#1{\if at fancyqr@gradient
-\pgfmathsetmacro\angle{Mod(\fancyqr at gradient@angle+225,360)}% rotate to align 0 to the right
-\pgfmathsetmacro\gradient{%
+\def\@@fancyqr at color@gradient#1{\edef\angle{\fpeval{%
+ % approximate mod
+ \fancyqr at gradient@angle+225 - floor((\fancyqr at gradient@angle+225)/360)*360
+}}% rotate to align 0 to the right
+\edef\gradient{\fpeval{%
% we do rotate the x and y points before color drawing by
% Mod(\fancyqr at gradient@angle,360) with the shifted origin
% Old: #3/2 #4/2
- ((\the\j-\@max at x/2)*cos(\angle) - (\the\i-\@max at y/2)*sin(\angle) + \@max at x/2)/\@max at x * 50% rel x [0,1]
- + ((\the\j-\@max at x/2)*sin(\angle) + (\the\i-\@max at y/2)*cos(\angle) + \@max at y/2)/\@max at y * 50% rel y [0,1]
- }\@declaredcolor{qr at fancy@gradient at br!\gradient!qr at fancy@gradient at tl}\else\@declaredcolor{qr at fancy@gradient at tl}\fi{#1}}
+ ((\the\j-\@half at max@x)*cos(\angle) - (\the\i-\@half at max@y)*sin(\angle) + \@half at max@x)/\@max at x * 50% rel x [0,1]
+ + ((\the\j-\@half at max@x)*sin(\angle) + (\the\i-\@half at max@y)*cos(\angle) + \@half at max@y)/\@max at y * 50% rel y [0,1]
+ }}\@declaredcolor{qr at fancy@gradient at br!\gradient!qr at fancy@gradient at tl}{#1}}
+\def\@@fancyqr at color@default#1{\@declaredcolor{qr at fancy@gradient at tl}{#1}}
+\def\@@fancyqr at color@random#1{\pgfmathrandomitem{\@fancyqr at random@c at l@r}{@@fancyqr@@randomcol}\@declaredcolor{\@fancyqr at random@c at l@r}{#1}}
+\let\FancyQrColor\@@fancyqr at color@default
+\def\fancyqr at rounding@factor{.5}
+\edef\fancyqr at rounding@other{\fpeval{1-\fancyqr at rounding@factor}}
+
% O 1 O
% 2 X 3
% O 4 O
@@ -26,43 +34,71 @@
\csname qcc\@up\@left\@right\@down\endcsname
\else\rule\qr at modulesize\z@\fi}
-\tikzset{qrrc/.style={rounded corners=.5\qr at modulesize},qrrd/.style={fill}}
+% backwards compatibility
+\def\fancyqr at clap#1{\hb at xt@\z@{\hss#1\hss}}
+\newdimen\fancyqr at edge@compensate
+\fancyqr at edge@compensate=.15\p@
% is larger to be compensated by overlaps
-\def\qrm{\dimexpr\qr at modulesize+.15\p@\relax}
+\def\qrm{\dimexpr\qr at modulesize+\fancyqr at edge@compensate\relax}
\long\def\qr at newpattern#1#2#3#4#5{%
-\expandafter\def\csname qcc#1#2#3#4\endcsname{%
- \parbox[b][\qr at modulesize]\qr at modulesize{\kern-.075\p@\smash{\clap{\tikz[x=\qrm,y=\qrm,inner sep=\z@,outer sep=\z@]{\path[qrrd]#5;}}}}%
+\expandafter\def\csname qcc#1#2#3#4\endcsname{\parbox[b][\qr at modulesize]\qr at modulesize{\kern-\fancyqr at edge@compensate\relax\smash{\fancyqr at clap{\picture(\@ne,\@ne)#5\endpicture}}}%
}}
-\def\FancyLoadDefault{%
+% [#3][#2]
+% [#4][#1]
+\def\fancyqr at rounded@rect#1#2#3#4{%
+ \ifnum#4=\@ne\relax \moveto(\fancyqr at rounding@factor,\z@)\else\moveto(\z@,\z@)\fi
+ \ifnum#1=\@ne
+ \lineto(\fancyqr at rounding@other,\z@)%
+ \circlearc\fancyqr at rounding@other\fancyqr at rounding@factor\fancyqr at rounding@factor{270}{360}
+ \else\lineto(\@ne,\z@)\fi
+ \ifnum#2=\@ne
+ \lineto(\@ne,\fancyqr at rounding@other)%
+ \circlearc\fancyqr at rounding@other\fancyqr at rounding@other\fancyqr at rounding@factor{0}{90}
+ \else\lineto(\@ne,\@ne)\fi
+ \ifnum#3=\@ne
+ \lineto(\fancyqr at rounding@factor,\@ne)%
+ \circlearc\fancyqr at rounding@factor\fancyqr at rounding@other\fancyqr at rounding@factor{90}{180}
+ \else\lineto(\z@,\@ne)\fi
+ \ifnum#4=\@ne
+ \lineto(\z@,\fancyqr at rounding@factor)%
+ \circlearc\fancyqr at rounding@factor\fancyqr at rounding@factor\fancyqr at rounding@factor{180}{270}
+ \else\lineto(\z@,\z@)\fi
+ \fancyqr at rounded@rect at close
+}
+\def\fancyqr at rounded@rect at close{\fillpath}
+
+\def\FancyQrLoadDefault{%
% .
-\qr at newpattern0000{[qrrc](0,0)rectangle(\qrm,\qrm)}%
+\qr at newpattern0000{\fancyqr at rounded@rect1111}%
% | | - -
-\qr at newpattern1000{(0,\qrm)[qrrc]--(0,0)--(\qrm,0)[sharp corners]--(\qrm,\qrm)--cycle}%
-\qr at newpattern0001{(0,0)[qrrc]--(0,\qrm)--(\qrm,\qrm)[sharp corners]--(\qrm,0)--cycle}%
-\qr at newpattern0100{(0,0)[qrrc]--(\qrm,0)--(\qrm,\qrm)[sharp corners]--(0,\qrm)--cycle}%
-\qr at newpattern0010{(\qrm,0)[qrrc]--(0,0)--(0,\qrm)[sharp corners]--(\qrm,\qrm)--cycle}%
+\qr at newpattern1000{\fancyqr at rounded@rect1001}%
+\qr at newpattern0001{\fancyqr at rounded@rect0110}%
+\qr at newpattern0100{\fancyqr at rounded@rect1100}%
+\qr at newpattern0010{\fancyqr at rounded@rect0011}%
% corners
-\qr at newpattern1100{(\qrm,\qrm)[qrrc]--(\qrm,0)[sharp corners]--(0,0)--(0,\qrm)--cycle}% top left
-\qr at newpattern1010{(0,\qrm)[qrrc]--(0,0)[sharp corners]--(\qrm,0)--(\qrm,\qrm)--cycle}% top right
-\qr at newpattern0101{(0,\qrm)[qrrc]--(\qrm,\qrm)[sharp corners]--(\qrm,0)--(0,0)--cycle}% bottom left
-\qr at newpattern0011{(0,0)[qrrc]--(0,\qrm)[sharp corners]--(\qrm,\qrm)--(\qrm,0)--cycle}% bottom right
+\qr at newpattern1100{\fancyqr at rounded@rect1000}% bottom right
+\qr at newpattern1010{\fancyqr at rounded@rect0001}% bottom left
+\qr at newpattern0101{\fancyqr at rounded@rect0100}% top right
+\qr at newpattern0011{\fancyqr at rounded@rect0010}% top left
% straights | --
-\qr at newpattern1001{(0,0)rectangle(\qrm,\qrm)}%
-\qr at newpattern0110{(0,0)rectangle(\qrm,\qrm)}%
+\qr at newpattern1001{\fancyqr at rounded@rect0000}%
+\qr at newpattern0110{\fancyqr at rounded@rect0000}%
% enclosed
-\qr at newpattern1111{(0,0)rectangle(\qrm,\qrm)}%
+\qr at newpattern1111{\fancyqr at rounded@rect0000}%
% t's
-\qr at newpattern0111{(0,0)rectangle(\qrm,\qrm)}%
-\qr at newpattern1011{(0,0)rectangle(\qrm,\qrm)}%
-\qr at newpattern1101{(0,0)rectangle(\qrm,\qrm)}%
-\qr at newpattern1110{(0,0)rectangle(\qrm,\qrm)}%
+\qr at newpattern0111{\fancyqr at rounded@rect0000}%
+\qr at newpattern1011{\fancyqr at rounded@rect0000}%
+\qr at newpattern1101{\fancyqr at rounded@rect0000}%
+\qr at newpattern1110{\fancyqr at rounded@rect0000}%
}
-\FancyLoadDefault % allows to reset the style after other loads
+\FancyQrLoadDefault % allows to reset the style after other loads
\def\@fancy at qr@default at name{default}
-\def\FancyQrLoad#1{\let\@tmp\newpattern\let\newpattern\qr at newpattern\@bsphack\def\@@tmp{#1}\ifx\@@tmp\@fancy at qr@default at name\FancyLoadDefault\else
+\def\FancyQrLoad#1{%
+\def\fancyqr at rounded@rect at close{\fillpath}%
+\let\@tmp\newpattern\let\newpattern\qr at newpattern\@bsphack\def\@@tmp{#1}\ifx\@@tmp\@fancy at qr@default at name\FancyQrLoadDefault\else
\expandafter\edef\csname pingu at lib@#1 at atcode\endcsname{\the\catcode`\@}%
\catcode`\@=11\relax
\input{fancyqr-style-#1.code}
@@ -108,6 +144,7 @@
\def\fancy at qr@printmatrix#1{%
\def\qr at white{0}\def\qr at black{1}%
+ \protected at edef\fancyqr at currprint{#1}%
\let\qr at black@fixed\qr at black
\let\qr at white@fixed\qr at white
\let\qr at black@format\qr at black
@@ -115,37 +152,39 @@
%Set module size
\qr at modulesize=\qr at desiredheight
\divide\qr at modulesize by \qr at size\relax
- \qr at minipagewidth=\qr at modulesize
+ \unitlength=\dimexpr\qr at modulesize+\fancyqr at edge@compensate\relax % initialize unitlength once
\if at fancyqr@image@% image is in \fancyqr at imgbox
- \pgfmathsetmacro\@x{int(ceil((.5\wd\fancyqr at imgbox)/\qr at modulesize)+\fancyqr at img@padding at x)}%
- \pgfmathsetmacro\@y{int(ceil((.5\ht\fancyqr at imgbox+.5\dp\fancyqr at imgbox)/\qr at modulesize)+\fancyqr at img@padding at y)}%
+ \edef\@x{\fpeval{ceil((.5\wd\fancyqr at imgbox)/\qr at modulesize)+\fancyqr at img@padding at x}}%
+ \edef\@y{\fpeval{ceil((.5\ht\fancyqr at imgbox+.5\dp\fancyqr at imgbox)/\qr at modulesize)+\fancyqr at img@padding at y}}%
\FancyQrDoNotPrintSquare\@x\@y
\fi
- \multiply\qr at minipagewidth by \qr at size\relax
- \ifqr at tight \else \advance\qr at minipagewidth by 8\qr at modulesize \fi
- \minipage\qr at minipagewidth
+ \qr at minipagewidth=\qr at desiredheight
+ \ifqr at tight \advance\qr at minipagewidth by -\qr at modulesize \else \advance\qr at minipagewidth by 7\qr at modulesize \fi
+ \minipage\qr at minipagewidth%
+ \hfuzz=\qr at modulesize
\baselineskip=\qr at modulesize
+ \lineskiplimit=\z@ \lineskip=\z@ \parskip=\z@
\ifqr at tight\else\rule\z@{4\qr at modulesize}\par\fi% %Blank space at top.
- \edef\@max at x{\qr at numberofrowsinmatrix{#1}}%
- \edef\@max at y{\qr at numberofcolsinmatrix{#1}}%
- \edef\@do at x@min{\the\numexpr\@max at x/2-\fancy at qr@donotprint at center@x-1}%
- \edef\@do at x@max{\the\numexpr\@max at x/2+\fancy at qr@donotprint at center@x+1}%
- \edef\@do at y@min{\the\numexpr\@max at y/2-\fancy at qr@donotprint at center@y-1}%
- \edef\@do at y@max{\the\numexpr\@max at y/2+\fancy at qr@donotprint at center@y+1}%
- \qr at for \i=1 to \@max at y by 1{%
+ \edef\@max at x{\qr at numberofrowsinmatrix\fancyqr at currprint}\edef\@half at max@x{\the\numexpr\@max at x/2}%
+ \edef\@max at y{\qr at numberofcolsinmatrix\fancyqr at currprint}\edef\@half at max@y{\the\numexpr\@max at y/2}%
+ \edef\@do at x@min{\the\numexpr\@half at max@x-\fancy at qr@donotprint at center@x-\@ne}%
+ \edef\@do at x@max{\the\numexpr\@half at max@x+\fancy at qr@donotprint at center@x+\@ne}%
+ \edef\@do at y@min{\the\numexpr\@half at max@y-\fancy at qr@donotprint at center@y-\@ne}%
+ \edef\@do at y@max{\the\numexpr\@half at max@y+\fancy at qr@donotprint at center@y+\@ne}%
+ \qr at for \i=\@ne to \@max at y by \@ne{%
\ifqr at tight\else\rule{4\qr at modulesize}\z@\fi% %Blank space at left.
- \qr at for \j=1 to \@max at x by 1{%
+ \qr at for \j=\@ne to \@max at x by \@ne{%
\qr at fancy@updateif\i\j
\iffancy at qr@do at print@
- \edef\@mid{\qr at matrixentry{#1}{\the\i}{\the\j}}%
+ \edef\@mid{\qr at matrixentry\fancyqr at currprint{\the\i}{\the\j}}%
\ifnum\@mid=\qr at white
\rule\qr at modulesize\z@
\else% if not white, get its pattern
- \iffancy at qr@roundcut@\qr at fancy@clear at surround{#1}{\the\i}{\the\j}\fi
- \edef\@up{\qr at matrixentry{#1}{\the\numexpr\the\i-1}{\the\j}}%
- \edef\@left{\qr at matrixentry{#1}{\the\i}{\the\numexpr\the\j-1}}%
- \edef\@right{\qr at matrixentry{#1}{\the\i}{\the\numexpr\the\j+1}}%
- \edef\@down{\qr at matrixentry{#1}{\the\numexpr\the\i+1}{\the\j}}%
+ \iffancy at qr@roundcut@\qr at fancy@clear at surround\fancyqr at currprint{\the\i}{\the\j}\fi
+ \edef\@up{\qr at matrixentry\fancyqr at currprint{\the\numexpr\the\i-1}{\the\j}}%
+ \edef\@left{\qr at matrixentry\fancyqr at currprint{\the\i}{\the\numexpr\the\j-1}}%
+ \edef\@right{\qr at matrixentry\fancyqr at currprint{\the\i}{\the\numexpr\the\j+1}}%
+ \edef\@down{\qr at matrixentry\fancyqr at currprint{\the\numexpr\the\i+1}{\the\j}}%
\FancyQrColor{\GetPattern}%
\fi\else \rule\qr at modulesize\z@\fi
}\par}%
@@ -152,7 +191,11 @@
\ifqr at tight\else\rule\z@{4\qr at modulesize}\par\fi
\endminipage
\if at fancyqr@image@\nobreak
- \llap{\parbox\qr at minipagewidth{\centering\usebox\fancyqr at imgbox}}\fi
+ \llap{\parbox\qr at minipagewidth{\centering\usebox\fancyqr at imgbox}%
+ % if half the width is odd, offset by half a module width, done by centering
+ \edef\@halfcheck{\fpeval{round(\fancy at qr@donotprint at center@x/2)}}%
+ \ifodd\@halfcheck \kern.5\qr at modulesize\fi
+ }\fi
}%
\def\fancy at qr@setup#1{%
@@ -205,17 +248,21 @@
}%
\newsavebox\fancyqr at imgbox
+\newif\if at fancyqr@randomcolor@
\define at key{fancyqr}{image x padding}{\def\fancyqr at img@padding at x{#1}}
\define at key{fancyqr}{image y padding}{\def\fancyqr at img@padding at y{#1}}
\define at key{fancyqr}{image padding}{\def\fancyqr at img@padding at x{#1}\def\fancyqr at img@padding at y{#1}}
\define at key{fancyqr}{image}{\@fancyqr at image@true\savebox\fancyqr at imgbox{#1}}
-\define at key{fancyqr}{color}{\@fancyqr at gradientfalse\colorlet{qr at fancy@gradient at tl}{#1}}
-\define at key{fancyqr}{left color}{\colorlet{qr at fancy@gradient at br}{#1}}
-\define at key{fancyqr}{l color}{\colorlet{qr at fancy@gradient at br}{#1}}
-\define at key{fancyqr}{right color}{\colorlet{qr at fancy@gradient at tl}{#1}}
-\define at key{fancyqr}{r color}{\colorlet{qr at fancy@gradient at tl}{#1}}
-\define at key{fancyqr}{gradient angle}{\def\fancyqr at gradient@angle{#1}}
+\define at key{fancyqr}{color}{\@fancyqr at randomcolor@false\@fancyqr at gradientfalse\colorlet{qr at fancy@gradient at tl}{#1}}
+\define at key{fancyqr}{left color}{\@fancyqr at randomcolor@false\colorlet{qr at fancy@gradient at br}{#1}}
+\define at key{fancyqr}{l color}{\@fancyqr at randomcolor@false\colorlet{qr at fancy@gradient at br}{#1}}
+\define at key{fancyqr}{right color}{\@fancyqr at randomcolor@false\colorlet{qr at fancy@gradient at tl}{#1}}
+\define at key{fancyqr}{r color}{\@fancyqr at randomcolor@false\colorlet{qr at fancy@gradient at tl}{#1}}
+\define at key{fancyqr}{gradient angle}{\@fancyqr at randomcolor@false\def\fancyqr at gradient@angle{#1}}
\define at boolkey{fancyqr}[@fancyqr@]{gradient}[true]{}% if at fancyqr@gradient
+\define at key{fancyqr}{random color}{\@fancyqr at randomcolor@true\def\@fancyqr at random@colors{#1}}
+\define at key{fancyqr}{width}{\setkeys{qr}{height=#1}}
+\define at key{fancyqr}{size}{\setkeys{qr}{height=#1}}
\def\fancyqrset#1{\setkeys{qr,fancyqr}{#1}}
\fancyqrset{image padding=0,gradient=true,gradient angle=135,r color=teal,l color=purple}
@@ -227,8 +274,12 @@
\def\ns at fancyqr{\qr at starinvokedfalse\@@fancyqr}
\newcommand\@@fancyqr[1][]{\begingroup\@fancyqr at init
\ifqr at starinvoked\qr at hyperlinkfalse\fi
-\setkeys{qr,fancyqr}{#1}\bgroup
-\qr at verbatimcatcodes\qr at setescapedspecials\qrcode at in}
+\setkeys{qr,fancyqr}{#1}%
+\if at fancyqr@randomcolor@%
+\ifcsname pgfmathdeclarerandomlist\endcsname\else
+\PackageError{fancyqr}{Random colors requested but pgfmath not loaded}{Please load pgfmath if you want this}\fi
+\pgfmathdeclarerandomlist{@@fancyqr@@randomcol}{\@fancyqr at random@colors}\let\FancyQrColor\@@fancyqr at color@random\else\if at fancyqr@gradient\let\FancyQrColor\@@fancyqr at color@gradient\fi\fi
+\bgroup\qr at verbatimcatcodes\qr at setescapedspecials\qrcode at in}
\endinput
% TODO: NEGATIVE PATTERNS IF MIDDLE IS 0
More information about the tex-live-commits
mailing list.