texlive[64141] Master: fancyqr (19aug22)

commits+karl at tug.org commits+karl at tug.org
Fri Aug 19 00:55:27 CEST 2022


Revision: 64141
          http://tug.org/svn/texlive?view=revision&revision=64141
Author:   karl
Date:     2022-08-19 00:55:27 +0200 (Fri, 19 Aug 2022)
Log Message:
-----------
fancyqr (19aug22)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/fancyqr/
    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/
    trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr.sty
    trunk/Master/tlpkg/tlpsrc/fancyqr.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/fancyqr/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fancyqr/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/fancyqr/README.md	2022-08-18 22:55:27 UTC (rev 64141)
@@ -0,0 +1,36 @@
+# fancyqr
+
+[![made-with-latex](https://img.shields.io/badge/Made%20with-LaTeX-1f425f.svg)](https://www.latex-project.org/) [![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)](https://opensource.org/licenses/GPL-3.0) [![PR's Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](http://makeapullrequest.com) [![compile qr](https://github.com/EagleoutIce/fancyqr/actions/workflows/compile.yaml/badge.svg)](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).
+
+*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)).
+
+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`.
+
+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.                                 |
+
+The defaults are set like this:
+
+```LateX
+\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.


Property changes on: trunk/Master/texmf-dist/doc/latex/fancyqr/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.pdf	2022-08-17 23:49:00 UTC (rev 64140)
+++ trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.pdf	2022-08-18 22:55:27 UTC (rev 64141)

Property changes on: trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.tex	2022-08-18 22:55:27 UTC (rev 64141)
@@ -0,0 +1,87 @@
+% Florian Sihler, 2022
+% 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}
+
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage{babel}
+
+\usepackage{microtype}
+\usepackage[hidelinks]{hyperref}
+
+\usepackage{lmodern}
+\usepackage{array,booktabs}
+\usepackage{footnote}
+\usepackage{fontawesome}
+
+\usepackage{fancyqr}
+\usepackage{xcolor}
+\usepackage[tex]{listings}
+
+\lstdefinelanguage{ltx}{
+	language={[LaTeX]TeX},
+	moretexcs=[1]{fancyqr,qrcode,FancyQrDoNotPrintSquare,FancyQrRoundCut,FancyQrHardCut,FancyQrLoad,FancyLoadDefault,fancyqrset,faGithub}
+}
+\lstset{basicstyle=\ttfamily,breaklines,texcsstyle=*\color{purple}\bfseries,language=ltx}
+\lstMakeShortInline|
+\def\ltx#1{\lstinline/#1/}
+\interfootnotelinepenalty=10000
+
+
+\title{The \texttt{fancyqr} package}
+\author{%
+	\texorpdfstring{Florian Sihler\medskip\\*
+		\fancyqr{https://github.com/EagleoutIce/fancyqr}
+	}{Florian Sihler}}
+\date{Version v1.0 \textendash\ 2022/08/18}
+
+
+\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.
+	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|.
+
+	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:
+\begin{lstlisting}
+\fancyqrset{image padding=0,gradient=true,
+	gradient angle=135,r color=teal,l color=purple}
+\end{lstlisting}
+	Consider the following example (uses \href{https://www.ctan.org/pkg/fontawesome}{fontawesome} for the symbol, but you can use include images,~\ldots):
+\begin{lstlisting}
+\fancyqr[image=\huge\faGithub,image padding=1,color=black!90!gray]{https://github.com/EagleoutIce/fancyqr}
+\end{lstlisting}
+
+	\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}
+
+\end{document}
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/fancyqr/fancyqr-doc.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/fancyqr/qr-example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fancyqr/qr-example.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/fancyqr/qr-example.tex	2022-08-18 22:55:27 UTC (rev 64141)
@@ -0,0 +1,25 @@
+% Florian Sihler, 2022
+% Licensed under GNU General Public License version 3
+% https://opensource.org/licenses/gpl-3.0.html
+\documentclass{article}
+
+\usepackage{fontawesome}
+
+\usepackage{fancyqr}
+
+\usepackage[active,tightpage]{preview} % for presentation
+\setlength\PreviewBorder{15pt}
+
+\fancyqrset{height=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}}%
+\endpreview
+\end{document}
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/fancyqr/qr-example.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr.sty	2022-08-18 22:55:27 UTC (rev 64141)
@@ -0,0 +1,235 @@
+% Florian Sihler, 2022
+% Licensed under GNU General Public License version 3
+% https://opensource.org/licenses/gpl-3.0.html
+\def\filename{fancyqr}
+\ProvidesPackage{\filename}[2022/08/18 version v1.0 Fancy QR-Codes]
+\RequirePackage{tikz, 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{%
+   % 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}}
+
+% O 1 O
+% 2 X 3
+% O 4 O
+% uses \@up\@left\@right\@down
+\def\GetPattern{%
+\ifcsname qcc\@up\@left\@right\@down\endcsname
+   \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}}
+
+% is larger to be compensated by overlaps
+\def\qrm{\dimexpr\qr at modulesize+.15\p@\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;}}}}%
+}}
+
+\def\FancyLoadDefault{%
+% .
+\qr at newpattern0000{[qrrc](0,0)rectangle(\qrm,\qrm)}%
+% | | - -
+\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}%
+% 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
+% straights | --
+\qr at newpattern1001{(0,0)rectangle(\qrm,\qrm)}%
+\qr at newpattern0110{(0,0)rectangle(\qrm,\qrm)}%
+% enclosed
+\qr at newpattern1111{(0,0)rectangle(\qrm,\qrm)}%
+% 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)}%
+}
+\FancyLoadDefault % 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
+\expandafter\edef\csname pingu at lib@#1 at atcode\endcsname{\the\catcode`\@}%
+\catcode`\@=11\relax
+\input{fancyqr-style-#1.code}
+\catcode`\@=\csname pingu at lib@#1 at atcode\endcsname
+\fi\@esphack\let\newpattern\@tmp\let\@tmp\relax}
+
+
+% modify the getter so everything that is not defined is white:
+\def\fancy at qr@matrixentry#1#2#3{%
+   \ifcsname #1@#2@#3\endcsname
+   % #1 = matrix name
+   % #2 = row number
+   % #3 = column number
+   \csname #1@#2@#3\endcsname
+   \else\qr at white@format\fi
+}%
+
+\def\FancyQrDoNotPrintSquare#1#2{\def\fancy at qr@donotprint at center@x{#1}\def\fancy at qr@donotprint at center@y{#2}}
+\FancyQrDoNotPrintSquare00
+
+\newif\iffancy at qr@do at print@
+\def\qr at fancy@updateif#1#2{\fancy at qr@do at print@true
+\ifnum#1>\@do at y@min\relax \ifnum#1<\@do at y@max\relax \ifnum#2>\@do at x@min\relax \ifnum#2<\@do at x@max\relax \fancy at qr@do at print@false \fi\fi\fi\fi}
+
+\newif\iffancy at qr@roundcut@
+\fancy at qr@roundcut at true
+\let\FancyQrHardCut\fancy at qr@roundcut at false
+\let\FancyQrRoundCut\fancy at qr@roundcut at true
+
+% clear plus if not to be printed
+\def\qr at fancy@clear at surround#1#2#3{%
+   \qr at fancy@updateif{\the\numexpr#2-1}{#3}%
+   \iffancy at qr@do at print@\else \expandafter\let\csname #1@\the\numexpr#2-1 @#3\endcsname\@undefined \fi
+   \qr at fancy@updateif{\the\numexpr#2+1}{#3}%
+   \iffancy at qr@do at print@\else \expandafter\let\csname #1@\the\numexpr#2+1 @#3\endcsname\@undefined \fi
+   \qr at fancy@updateif{#2}{\the\numexpr#3-1}%
+   \iffancy at qr@do at print@\else \expandafter\let\csname #1@#2@\the\numexpr#3-1\endcsname\@undefined \fi
+   \qr at fancy@updateif{#2}{\the\numexpr#3+1}%
+   \iffancy at qr@do at print@\else \expandafter\let\csname #1@#2@\the\numexpr#3+1\endcsname\@undefined \fi
+}
+
+\newif\if at fancyqr@image@
+
+\def\fancy at qr@printmatrix#1{%
+   \def\qr at white{0}\def\qr at black{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
+  %Set module size
+  \qr at modulesize=\qr at desiredheight
+  \divide\qr at modulesize by \qr at size\relax
+  \qr at minipagewidth=\qr at modulesize
+  \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)}%
+   \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
+      \baselineskip=\qr at modulesize
+      \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{%
+      \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 fancy@updateif\i\j
+         \iffancy at qr@do at print@
+         \edef\@mid{\qr at matrixentry{#1}{\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}}%
+            \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}}\fi
+}%
+
+\def\fancy at qr@setup#1{%
+   \qr at creatematrix{#1}%
+   \expandafter\gdef\csname #1 at numrows\endcsname{\qr at size}%
+   \expandafter\gdef\csname #1 at numcols\endcsname{\qr at size}%
+   % we do not need to create blank because we store all
+   \qr at placefinderpatterns{#1}%
+   \qr at placetimingpatterns{#1}%
+   \qr at placealignmentpatterns{#1}%
+}
+
+\newcount\c at fancy@a \newcount\c at fancy@b
+% the normal data is... well...
+\def\fancy at qr@writedata#1#2{%
+  % #1 = name of a matrix that has been prepared with finder patterns, timing patterns, etc.
+  % #2 = a string consisting of 0's and 1's to write into the matrix.
+  \expandafter\c at fancy@a\the\numexpr\qr at numberofrowsinmatrix{#1}\relax
+  \expandafter\c at fancy@b\the\numexpr\qr at numberofcolsinmatrix{#1}\relax
+  \edef\qr at datatowrite{#2\relax}%
+  \c at qr@i0\relax
+  \@whilenum\c at qr@i<\c at fancy@a\do{%
+      \c at qr@j0 \advance\c at qr@i\@ne
+      \@whilenum\c at qr@j<\c at fancy@b\do{%
+         \advance\c at qr@j\@ne
+         \expandafter\fancy at qr@writebit\qr at datatowrite:{#1}%
+      }%
+  }%
+}
+
+\def\fancy at qr@writebit#1#2:#3{%
+  % #3 = matrix name
+  % (qr at i,qr at j) = position to write in (LaTeX counters)
+  % #1 = bit to be written
+  % #2 = remaining bits plus '\relax' as an end-of-file marker
+  \edef\qr at datatowrite{#2}%
+  \ifnum#1=1
+    \qr at storetomatrix{#3}{\number\c at qr@i}{\number\c at qr@j}{\qr at black}%
+  \else
+    \qr at storetomatrix{#3}{\number\c at qr@i}{\number\c at qr@j}{\qr at white}%
+  \fi
+}%
+
+
+\def\fancy at qr@printsavedbinarymatrix#1{%
+   \def\qr at binarystring{#1\relax\relax}%
+   \fancy at qr@setup{@tmp}%
+   \fancy at qr@writedata{@tmp}{\qr at binarystring}%
+   \fancy at qr@printmatrix{@tmp}%
+}%
+
+\newsavebox\fancyqr at imgbox
+\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 boolkey{fancyqr}[@fancyqr@]{gradient}[true]{}% if at fancyqr@gradient
+
+\def\fancyqrset#1{\setkeys{qr,fancyqr}{#1}}
+\fancyqrset{image padding=0,gradient=true,gradient angle=135,r color=teal,l color=purple}
+
+\def\@fancyqr at init{\let\qr at printsavedbinarymatrix\fancy at qr@printsavedbinarymatrix\let\qr at matrixentry\fancy at qr@matrixentry\let\qr at printmatrix\fancy at qr@printmatrix}
+\def\fancyqr{\@ifstar\s at fancyqr\ns at fancyqr}
+% we rebuild some parts of qrcode to allow this macro to extend the keys while keeping the wrapper
+\def\s at fancyqr{\qr at starinvokedtrue\@@fancyqr}
+\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}
+\endinput
+
+% TODO: NEGATIVE PATTERNS IF MIDDLE IS 0
+% => make rounded negative corners
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/fancyqr/fancyqr.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2022-08-17 23:49:00 UTC (rev 64140)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2022-08-18 22:55:27 UTC (rev 64141)
@@ -311,7 +311,7 @@
     extpfeil extract extsizes
   facsimile factura facture facture-belge-simple-sans-tva faktor familytree
     fancybox fancyhandout fancyhdr fancyhdr-it fancylabel fancynum fancypar
-    fancyref fancyslides fancytabs fancytooltips fancyvrb fandol
+    fancyqr fancyref fancyslides fancytabs fancytooltips fancyvrb fandol
     fascicules fast-diagram fbb fbithesis fbox fbs
     fc fcavtex fcltxdoc fcolumn fdsymbol fduthesis featpost fei fenixpar
     fetamont fetchcls

Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2022-08-17 23:49:00 UTC (rev 64140)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2022-08-18 22:55:27 UTC (rev 64141)
@@ -476,6 +476,7 @@
 depend fancylabel
 depend fancynum
 depend fancypar
+depend fancyqr
 depend fancyslides
 depend fancytabs
 depend fancytooltips

Added: trunk/Master/tlpkg/tlpsrc/fancyqr.tlpsrc
===================================================================


More information about the tex-live-commits mailing list.