texlive[72472] Master/texmf-dist: fancyqr (5oct24)
commits+karl at tug.org
commits+karl at tug.org
Sat Oct 5 21:36:57 CEST 2024
Revision: 72472
https://tug.org/svn/texlive?view=revision&revision=72472
Author: karl
Date: 2024-10-05 21:36:57 +0200 (Sat, 05 Oct 2024)
Log Message:
-----------
fancyqr (5oct24)
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.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/fancyqr/qr-minimal.tex
Removed Paths:
-------------
trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-swift.code
Modified: trunk/Master/texmf-dist/doc/latex/fancyqr/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fancyqr/README.md 2024-10-05 19:36:44 UTC (rev 72471)
+++ trunk/Master/texmf-dist/doc/latex/fancyqr/README.md 2024-10-05 19:36:57 UTC (rev 72472)
@@ -5,7 +5,7 @@
[<img src="https://github.com/EagleoutIce/fancyqr/blob/gh-pages/preview-1.png?raw=true" width="600"/>](qr-example.tex)
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).
+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). If you just want to create a simple qr-code, please refer to the [minimal example](qr-minimal.tex).
*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>).
@@ -13,23 +13,29 @@
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 |
-| ----------------- | ------- | :------: | ---------------------------------------------------------- |
-| `image` | LaTeX | | Automatically center an image.[^1] |
-| `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 qr 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][qrcode] `height` option. |
-| `size` | length | | Alias for [`qrcode`'s][qrcode] `height` option. |
+| Option | Type | Default | Explanation |
+| ----------------- | ----------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------ |
+| `classic` | boolean | `false` | Use the classic qr-code style (black with flat rectangles, this loads the `flat` style). |
+| `color` | color | | Disables the `gradient` and sets the qr color accordingly. |
+| `gradient angle` | angle | `135` | Change the gradient angle. |
+| `gradient` | boolean | true | Toggle the color gradient |
+| `image` | LaTeX | | Automatically center an image (you have to care for the size and maybe adjust the `version` and `level` to keep the qr-code readable).[^1] |
+| `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. |
+| `l color` | color | `purple` | Set the top left gradient color. |
+| `left color` | color | | Alias for `l color`. |
+| `level` | L/M/Q/H | `M` | [`qrcode`][qrcode] option affecting error correction (low, medium, quartile, high). |
+| `padding` | flag | | [`qrcode`][qrcode] option adding sufficient additional space around the qr-code. |
+| `r color` | color | `teal` | Set the bottom right gradient color. |
+| `random color` | colors | | Allow to set a random color pool to pick from. |
+| `right color` | color | | Alias for `r color`. |
+| `size` | length | | Alias for [`qrcode`'s][qrcode] `height` option. |
+| `tight` | flag | | [`qrcode`][qrcode] option adding no additional space around the qr-code. |
+| `version` | [0..40] ∈ ℕ | `0` | [`qrcode`][qrcode] option affecting the size (tries to be as small as possible). |
+| `width` | length | | Alias for [`qrcode`'s][qrcode] `height` option. |
+
The defaults are set like this:
```LateX
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-10-05 19:36:44 UTC (rev 72471)
+++ trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.tex 2024-10-05 19:36:57 UTC (rev 72472)
@@ -18,6 +18,7 @@
\usepackage{fancyqr}
\usepackage{xcolor}
\usepackage[tex]{listings}
+\usepackage{amssymb}
\lstdefinelanguage{ltx}{
language={[LaTeX]TeX},
@@ -34,14 +35,13 @@
\texorpdfstring{Florian Sihler\medskip\\*
\fancyqr{https://github.com/EagleoutIce/fancyqr}
}{Florian Sihler}}
-\date{Version v2.0 \textendash{} 2024/04/13}
+\date{Version v2.1 \textendash{} 2024/10/05}
-
\begin{document}
\maketitle
- \texttt{fancyqr} is a simple package to create fancy qr codes with the help of the \textit{\href{https://www.ctan.org/pkg/qrcode}{qrcode}}-package.
+ \texttt{fancyqr} is a simple package to create fancy qr-codes with the help of the \textit{\href{https://www.ctan.org/pkg/qrcode}{qrcode}}-package.
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|.
@@ -66,20 +66,25 @@
\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.} \\
+ classic & boolean & false & Use the classic qr-code style (black with flat rectangles, this loads the |flat| style). \\
+ color & color & & Disables the |gradient| and sets the color accordingly. \\
+ gradient & boolean & true & Toggle the color gradient \\
+ gradient angle & angle & 135 & Change the gradient angle. \\
+ image & \LaTeX & & Automatically center an image (you have to care for the size and maybe adjust the |version| and |level| to keep the qr-code readable).\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|. \\
+ level & L/M/Q/H & M & |qrcode| option affecting error correction (low, medium, quartile, high). \\
+ padding & flag & & |qrcode| option adding sufficient additional space around the qr-code. \\
r color & color & teal & Set the bottom right gradient color. \\
+ random color & colors & & Allow to set a random color pool to pick from. \\
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. \\
+ size & length & & Alias for |qrcode|'s |height| option. \\
+ tight & flag & & |qrcode| option adding no additional space around the qr-code. \\
+ version & \([0..40] \in \mathbb{N}\) & 0 & |qrcode| option affecting the size (tries to be as small as possible). \\
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.}
Modified: trunk/Master/texmf-dist/doc/latex/fancyqr/qr-example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fancyqr/qr-example.tex 2024-10-05 19:36:44 UTC (rev 72471)
+++ trunk/Master/texmf-dist/doc/latex/fancyqr/qr-example.tex 2024-10-05 19:36:57 UTC (rev 72472)
@@ -3,6 +3,7 @@
% https://opensource.org/licenses/gpl-3.0.html
\documentclass{article}
+\usepackage[T1]{fontenc}
\usepackage{fontawesome}
\usepackage{fancyqr}
@@ -13,13 +14,18 @@
% to showcase scalebox
\usepackage{graphicx}
+% for the coding font
+\usepackage{FiraMono}
+
\usepackage[active,tightpage]{preview} % for presentation
\setlength\PreviewBorder{15pt}
-\fancyqrset{size=3.25cm,level=H,padding}
+\fancyqrset{size=3.25cm, level=H, padding}
+\errorcontextlines=9999
\begin{document}
\preview
+\begin{center}
% \FancyQrDoNotPrintSquare{8}{9}
% \FancyQrHardCut
\mbox{\FancyQrLoad{blobs}%
@@ -28,6 +34,8 @@
\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}%
-}%
+}\\[4mm]
+\texttt{\textbackslash \textbf{fancyqr}\{\textcolor{@Grey}{https://github.com/EagleoutIce/fancyqr}\}}
+\end{center}
\endpreview
\end{document}
\ No newline at end of file
Added: trunk/Master/texmf-dist/doc/latex/fancyqr/qr-minimal.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fancyqr/qr-minimal.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/fancyqr/qr-minimal.tex 2024-10-05 19:36:57 UTC (rev 72472)
@@ -0,0 +1,12 @@
+\documentclass{article}
+
+\usepackage{fancyqr}
+
+\usepackage[active,tightpage]{preview}
+\setlength\PreviewBorder{0pt}
+
+\begin{document}
+\preview
+\fancyqr[classic,padding]{https://github.com/EagleoutIce/fancyqr}
+\endpreview
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/latex/fancyqr/qr-minimal.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-blobs.code
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-blobs.code 2024-10-05 19:36:44 UTC (rev 72471)
+++ trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-blobs.code 2024-10-05 19:36:57 UTC (rev 72472)
@@ -3,11 +3,11 @@
\@tempcnta=\z@
\roundjoin
\roundcap
-\moveto(0,0)
+\moveto(.5,.5)
\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})
+\edef\rad{\fpeval{.1*\qr at modulesize+.13*\qr at modulesize*abs(rand())}}% fixed rand for both
+\lineto(\fpeval{cos(\@tempcnta)*\rad+.5},\fpeval{sin(\@tempcnta)*\rad+.5})
\ifnum\@tempcnta<360\relax
\repeat
\fillpath
Modified: trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-dots.code
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-dots.code 2024-10-05 19:36:44 UTC (rev 72471)
+++ trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-dots.code 2024-10-05 19:36:57 UTC (rev 72472)
@@ -1,4 +1,4 @@
-\def\fancyqr at dots@circle{\put(.5,.5){\circle*{\@ne}}}
+\def\fancyqr at dots@circle{\put(.5,.5){\circle*{\@ne}}}%
% .
\newpattern0000{\fancyqr at dots@circle}%
% | | - -
Deleted: trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-swift.code
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-swift.code 2024-10-05 19:36:44 UTC (rev 72471)
+++ trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr-style-swift.code 2024-10-05 19:36:57 UTC (rev 72472)
@@ -1,2 +0,0 @@
-\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-10-05 19:36:44 UTC (rev 72471)
+++ trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr.sty 2024-10-05 19:36:57 UTC (rev 72472)
@@ -2,7 +2,7 @@
% Licensed under GNU General Public License version 3
% https://opensource.org/licenses/gpl-3.0.html
\def\filename{fancyqr}
-\ProvidesPackage{\filename}[2024/04/13 version v2.0 Fancy QR-Codes]
+\ProvidesPackage{\filename}[2024/10/05 version v2.1 Fancy QR-Codes]
\RequirePackage{pict2e, xfp, qrcode}
% element
@@ -32,18 +32,21 @@
\def\GetPattern{%
\ifcsname qcc\@up\@left\@right\@down\endcsname
\csname qcc\@up\@left\@right\@down\endcsname
-\else\rule\qr at modulesize\z@\fi}
+\fi}
% 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@
+\newdimen\fancyqr at edge@compensate \fancyqr at edge@compensate=.15\p@
% is larger to be compensated by overlaps
\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-\fancyqr at edge@compensate\relax\smash{\fancyqr at clap{\picture(\@ne,\@ne)#5\endpicture}}}%
-}}
+\expandafter\def\csname qcc#1#2#3#4\endcsname{% scaling happens implicitly by the unitlength
+ \put(\the\j,\the\numexpr\@max at y-\the\i){%
+ \advance\unitlength by\fancyqr at edge@compensate\relax
+ #5%
+ }}%
+}
% [#3][#2]
% [#4][#1]
@@ -97,11 +100,13 @@
\def\@fancy at qr@default at name{default}
\def\FancyQrLoad#1{%
+\protected at edef\fancyqr at loaded@style{#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
+\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}
+\input{fancyqr-style-#1.code}%
\catcode`\@=\csname pingu at lib@#1 at atcode\endcsname
\fi\@esphack\let\newpattern\@tmp\let\@tmp\relax}
@@ -145,14 +150,12 @@
\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
- \let\qr at white@format\qr at white
+ \let\qr at black@fixed\qr at black \let\qr at white@fixed\qr at white
+ \let\qr at black@format\qr at black \let\qr at white@format\qr at white
%Set module size
- \qr at modulesize=\qr at desiredheight
+ \qr at modulesize=\qr at desiredheight\relax
\divide\qr at modulesize by \qr at size\relax
- \unitlength=\dimexpr\qr at modulesize+\fancyqr at edge@compensate\relax % initialize unitlength once
+ \unitlength=\dimexpr\qr at modulesize\relax % will be re-set in placement
\if at fancyqr@image@% image is in \fancyqr at imgbox
\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}}%
@@ -159,43 +162,51 @@
\FancyQrDoNotPrintSquare\@x\@y
\fi
\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.
+ \ifqr at tight\else \advance\qr at minipagewidth by 8\qr at modulesize\relax \fi
+ \begingroup
\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}%
+ % redefine the border to be white!
+ \qr at for \i=\@ne to \@max at y by \@ne{%
+ % redefine the limits to be white!
+ \qr at storetomatrix\fancyqr at currprint{\the\numexpr\z@}{\the\i}{\qr at white}%
+ \qr at storetomatrix\fancyqr at currprint{\the\numexpr\@max at x+\@ne}{\the\i}{\qr at white}%
+ }%
+ \qr at for \i=\@ne to \@max at x by \@ne{%
+ \qr at storetomatrix\fancyqr at currprint{\the\i}{\the\numexpr\z@}{\qr at white}%
+ \qr at storetomatrix\fancyqr at currprint{\the\i}{\the\numexpr\@max at y+\@ne}{\qr at white}%
+ }%
\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=\@ne to \@max at x by \@ne{%
+ \edef\@tmp at tight{\ifqr at tight\z@\else-4\fi}%
+ \picture(\qr at minipagewidth,\qr at minipagewidth)(\the\numexpr\@ne+\@tmp at tight,\@tmp at tight)
+ \qr at for \i=\@ne to \@max at y by \@ne{\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\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\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}%
- \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}%
- % 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
+ \edef\@mid{\qr at matrixentry\fancyqr at currprint{\the\i}{\the\j}}%
+ \ifnum\@mid=\qr at black\relax
+ \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-\@ne}{\the\j}}%
+ \edef\@left{\qr at matrixentry\fancyqr at currprint{\the\i}{\the\numexpr\the\j-\@ne}}%
+ \edef\@right{\qr at matrixentry\fancyqr at currprint{\the\i}{\the\numexpr\the\j+\@ne}}%
+ \edef\@down{\qr at matrixentry\fancyqr at currprint{\the\numexpr\the\i+\@ne}{\the\j}}%
+ \FancyQrColor{\GetPattern}%
+ \fi\fi
+ }}%
+ \if at fancyqr@image@
+ % floating point mid
+ \put(\fpeval{.5*\@max at x+.5},\fpeval{.5*\@max at y}){%
+ \edef\@halfcheck{\fpeval{round(\fancy at qr@donotprint at center@x/2)}}%
+ \raisebox{-.5\height}{\clap{% TODO: remove this offset
+ \ifodd\@halfcheck \else\kern\qr at modulesize\fi
+ \usebox\fancyqr at imgbox
+ }}%
+ }%
+ \fi
+ \endpicture
+ \endgroup
}%
\def\fancy at qr@setup#1{%
@@ -263,6 +274,15 @@
\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}}
+% \fancyqr at loaded@style
+\def\fancyqr at flat@style{flat}
+\define at boolkey{fancyqr}[@fancyqr@]{classic}[true]{} % if at fancyqr@classic
+\def\fancyqr at classic{%
+\ifx\fancyqr at loaded@style\fancyqr at flat@style\else\FancyQrLoad{\fancyqr at flat@style}\fi
+\setkeys{fancyqr}{%
+ gradient=false,color=black,l color=black,r color=black%
+}%
+}
\def\fancyqrset#1{\setkeys{qr,fancyqr}{#1}}
\fancyqrset{image padding=0,gradient=true,gradient angle=135,r color=teal,l color=purple}
@@ -275,6 +295,7 @@
\newcommand\@@fancyqr[1][]{\begingroup\@fancyqr at init
\ifqr at starinvoked\qr at hyperlinkfalse\fi
\setkeys{qr,fancyqr}{#1}%
+\if at fancyqr@classic\fancyqr at classic\fi%
\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
@@ -281,6 +302,3 @@
\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
-% => make rounded negative corners
More information about the tex-live-commits
mailing list.