diff options
Diffstat (limited to 'graphics/pgf')
-rw-r--r-- | graphics/pgf/contrib/pixelarttikz/doc/PAkoala.csv | 40 | ||||
-rw-r--r-- | graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.pdf | bin | 537723 -> 695668 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.tex | 128 | ||||
-rw-r--r-- | graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.pdf | bin | 546242 -> 735970 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.tex | 337 | ||||
-rw-r--r-- | graphics/pgf/contrib/pixelarttikz/tex/PixelArtTikz.sty | 527 |
6 files changed, 989 insertions, 43 deletions
diff --git a/graphics/pgf/contrib/pixelarttikz/doc/PAkoala.csv b/graphics/pgf/contrib/pixelarttikz/doc/PAkoala.csv new file mode 100644 index 0000000000..3944b29595 --- /dev/null +++ b/graphics/pgf/contrib/pixelarttikz/doc/PAkoala.csv @@ -0,0 +1,40 @@ +A,A,A,A,A,A,A,H,H,H,A,A,A,A,A,H,H,H,A,A,A,A,A,A,A,A,A,H,H,H,H,A,A,H,A,A,A,A,A,A +A,A,A,A,A,A,A,A,H,A,A,A,A,A,A,H,H,A,A,A,A,A,A,A,A,A,A,H,A,A,A,A,A,H,A,A,A,A,A,A +A,A,A,H,A,A,A,A,A,A,A,A,A,A,A,H,H,A,A,A,A,A,A,A,A,H,H,H,A,A,A,A,A,A,A,A,A,A,A,A +A,A,A,A,A,A,A,B,E,E,E,E,A,A,A,A,A,A,A,A,A,A,A,H,H,H,A,B,B,E,E,E,E,B,A,A,A,A,A,H +A,A,H,A,A,A,A,B,E,E,E,E,E,A,A,A,A,A,A,A,A,A,A,H,H,H,B,E,E,E,E,E,E,B,B,A,A,A,A,H +A,A,H,A,A,B,B,E,C,C,C,C,C,E,B,B,B,E,E,E,E,E,E,B,B,B,E,C,C,C,C,C,C,E,B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,F,F,G,G,C,C,C,C,C,C,C,D,B,I,A,A,A,A,A,A,A +A,A,A,A,A,A,A,I,B,D,D,D,C,C,C,B,B,B,G,G,G,G,B,B,B,C,C,C,D,D,D,B,I,A,A,A,A,A,A,A +A,A,A,A,A,H,A,I,I,B,D,D,D,D,D,C,C,C,B,D,D,B,C,C,C,C,D,D,D,B,B,I,I,A,A,A,A,A,A,A +A,A,A,A,A,H,H,H,I,B,B,D,D,D,D,D,C,C,B,D,D,B,C,C,C,D,D,D,D,B,I,I,A,A,A,A,A,A,A,A +A,A,H,H,H,A,A,A,I,I,I,B,B,B,D,B,B,B,B,B,B,B,B,B,B,D,B,B,B,I,I,I,A,A,A,A,A,A,H,A +A,A,H,H,H,A,A,A,A,I,I,I,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,I,I,I,A,A,A,A,A,A,A,H,A +H,H,A,H,H,A,A,A,A,A,A,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,A,A,A,A,A,A,A,A,A,A +A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,I,I,I,I,I,I,I,I,I,A,A,A,A,A,A,A,A,A,A,A,H,A,A,A,A +A,A,A,A,A,A,A,A,A,A,A,A,H,H,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,H,H,A,A,A,A diff --git a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.pdf b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.pdf Binary files differindex 9f57e4ebb8..5c53a4bbf0 100644 --- a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.pdf +++ b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.pdf diff --git a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.tex b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.tex index e1b74bae3b..9c3001979a 100644 --- a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.tex +++ b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.tex @@ -7,6 +7,7 @@ \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb} \usepackage{PixelArtTikz} +\usepackage{couleurs-fr} \usepackage{fontawesome5} \usepackage{enumitem} \usepackage{tabularray} @@ -44,8 +45,8 @@ \usepackage[margin=1.5cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.2} -\def\TPdate{12/10/2023} +\def\TPversion{0.1.3} +\def\TPdate{11/04/2024} \usepackage[most]{tcolorbox} \tcbuselibrary{minted} @@ -603,10 +604,133 @@ Inline, we can give \MiniPixlArt[Unit=5mm,Border]{BCGOYG,YLP.BR}<baseline=(curre this miniPA. \end{PresentationCode} +\newpage + +\section{Macro for cutting PixelArt} + +\subsection{Idea} + +The idea is to offer commands to create \textit{collaborative} PixelArts, to form a \textit{large} image from several small ones (of the same size). + +\smallskip + +{\footnotesize\faBomb} For practical reasons (related to the use of \texttt{filecontents}) the file \textsf{csv} must end with an empty line (it is created automatically via \texttt{filecontents}, and the code uses this specificity). + +\smallskip + +The available \Cle{keys} are exactly the same as those in classic displays. + +\subsection{Global usage} + +The argument \texttt{cutting} can be given in the form : +% +\begin{itemize} + \item \Cle{<number of block length>x<number of block col>} to specify the size of the blocks; + \item \Cle{<number of V blocks>+<number of H blocks>} to specify the number of blocks. +\end{itemize} + +\begin{PresentationCode}{listing only} +\CutPixlArtTikz(*)[keys]<tikz options>{file.csv}{cutting} +%(*) := change layout formatting (A1 or 1.1) +%1 := keys +%2 := tikz options +%3 := csv file +%4 := block size (LxC) or block number (L+C) + +\HelpGridPixelArtTikz(*)[scale]{file.csv}{cutting} +%(*) := change layout formatting (A1 or 1.1) +%1 := scale of notice +%2 := csv file +%4 := block size (LxC) or block number (L+C) +\end{PresentationCode} + +\begin{filecontents*}[overwrite]{PAkoala.csv} +A,A,A,A,A,A,A,H,H,H,A,A,A,A,A,H,H,H,A,A,A,A,A,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A +A,A,A,A,A,A,A,A,A,A,A,A,H,H,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,H,H,A,A,A,A +\end{filecontents*} + +\subsection{Example} + +\def\listcoulkoala% +{VertForet,Noir,GrisClair,GrisFonce,Beige,Blanc,BleuClair,VertClair,Marron} + +\begin{PresentationCode}{listing only} +\def\listcoulkoala% + {VertForet,Noir,GrisClair,GrisFonce,Beige,Blanc,BleuClair,VertClair,Marron} +\end{PresentationCode} + +\begin{PresentationCode}{} +%block with 8x8 size +\HelpGridPixelArtTikz{PAkoala.csv}{8x8} +~~ +\PixlArtTikz[Correction,Unit=0.125,Codes=ABCDEFGHI,Colors={\listcoulkoala},Grid=8x8]{PAkoala.csv} +\end{PresentationCode} + +\begin{PresentationCode}{} +%16 blocks (4L 4C) +\HelpGridPixelArtTikz*[2]{PAkoala.csv}{4+4} +~~ +\PixlArtTikz[Correction,Unit=0.2,Codes=ABCDEFGHI,Colors={\listcoulkoala},Grid=4+4]{PAkoala.csv} +\end{PresentationCode} + +\newpage + +\begin{PresentationCode}{} +%block with 8x8 size +\CutPixlArtTikz[Unit=0.3,Codes=ABCDEFGHI]{PAkoala.csv}{8x8} +\end{PresentationCode} + +\pagebreak + +\begin{PresentationCode}{} +%16 blocks (4L 4C) +\CutPixlArtTikz*[Unit=0.3,Codes=ABCDEFGHI,Correction,Colors={\listcoulkoala}]{PAkoala.csv}{4+4} +\end{PresentationCode} + \pagebreak \part{History} +\verb|v0.1.3|~:~~~~Cut PixelArts within several PixelArts + \verb|v0.1.2|~:~~~~\textit{mini-}PixelArts \verb|v0.1.1|~:~~~~Bugfix with color diff --git a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.pdf b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.pdf Binary files differindex 51ae5d72dc..a4dbde2b0c 100644 --- a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.pdf +++ b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.pdf diff --git a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.tex b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.tex index 54f690e890..5af486a5aa 100644 --- a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.tex +++ b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.tex @@ -8,6 +8,7 @@ %\usepackage[table,svgnames]{xcolor} \usepackage{amsmath,amssymb} \usepackage{PixelArtTikz} +\usepackage{couleurs-fr} \usepackage{fontawesome5} \usepackage{enumitem} \usepackage{tabularray} @@ -43,8 +44,8 @@ \usepackage[margin=1.5cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.2} -\def\TPdate{12 octobre 2023} +\def\TPversion{0.1.3} +\def\TPdate{11 avril 2024} \usepackage[most]{tcolorbox} \tcbuselibrary{minted} @@ -110,6 +111,10 @@ \smallskip +{$\blacktriangleright$~~Des commandes pour découper des PixelArts en plusieurs parties.} + +\smallskip + {$\blacktriangleright$~~Environnement pour compléter éventuellement le PixelArt.} \smallskip @@ -242,18 +247,20 @@ Il charge les packages et librairies suivantes : \begin{itemize} \item \texttt{tikz}, \texttt{xintexpr} et \texttt{xinttools}; - \item \texttt{xstring}, \texttt{xparse}, \texttt{simplekv} et \texttt{listofitems}. + \item \texttt{xstring}, \texttt{xparse}, \texttt{simplekv} et \texttt{listofitems} ; + \item \texttt{multicol} (pour le \textit{découpage}). \end{itemize} \pagebreak \subsection{Commandes et environnement} -Il existe deux manières de représenter un PixelArt : +Il existe trois manières de représenter un PixelArt : \begin{itemize} \item soit par une commande autonome et indépendante ; - \item soit par un environnement Ti\textit{k}Z dans lequel du code pourra être \textit{rajouté}. + \item soit par un environnement Ti\textit{k}Z dans lequel du code pourra être \textit{rajouté} ; + \item soit par \textit{découpage} de la grille en plusieurs (travail collaboratif). \end{itemize} \begin{PresentationCode}{listing only} @@ -269,6 +276,17 @@ Il existe deux manières de représenter un PixelArt : \end{EnvPixelArtTikz} \end{PresentationCode} +\begin{PresentationCode}{listing only} +%Affichage d'un bloc précis (si découpage) +\PixelArtTikzBloc[clés]<options tikz>{fichier.csv}{découpage}{num bloc} + +%Affichage des blocs (si découpage) +\DecoupPixelArtTikz(*)[clés]<options tikz>{fichier.csv}{découpage} + +%Affichage d'une 'aide' +\AideGrillePixelArtTikz(*)[Echelle]{fichier.csv}{découpage} +\end{PresentationCode} + \section{Les couleurs} Concernant les couleurs, l'utilisateur utilisera celles disponibles avec les packages chargés. @@ -305,6 +323,10 @@ Les couleurs disponibles sans autre package sont donc : \SetCell{bg=orange} orange & \\ \end{tblr} +\smallskip + +Pour des couleurs \textit{francisées}, le package \texttt{couleurs-fr} pourra être utile. + \section{Petit aparté sur les fichiers csv} \textsf{CSV} désigne un format de fichiers dont le rôle est de présenter des données séparées par des virgules. Il s'agit d'une manière simplifiée d'afficher des données afin de les rendre transmissibles d'un programme à un autre. @@ -383,6 +405,11 @@ Le premier argument, \textit{optionnel} et entre \texttt{[...]} propose des \tex \item la clé booléenne \Cle{Correction} qui permet de colorier le PixelArt ;\hfill{}défaut \textsf{false} \item la clé booléenne \Cle{Symb} qui permet d'afficher les caractères \textit{alternatifs} ;\hfill{}défaut \textsf{false} \item la clé booléenne \Cle{BordCases} qui permet d'afficher les bords des cases de la correction ;\hfill{}défaut \textsf{true} + \item la clé \Cle{Decoupage} pour afficher des lignes de découpage éventuel : + \begin{itemize} + \item sous la forme \Cle{<nb lig bloc>x<nb col bloc>} pour spécifier la dimension des blocs ; + \item sous la forme \Cle{<nb blocs V>+<nb blocs H>} pour spécifier le nombre de blocs ; + \end{itemize} \item la clé \Cle{Style} qui permet de spécifier le style des caractères. \hfill{}défaut \textsf{scriptsize} \end{itemize} @@ -566,6 +593,197 @@ Les symboles affichés dans les cases sont situés aux nœuds de coordonnées $( \newpage +\section{La commande pour découper} + +\subsection{Idée et fonctionnement global} + +L'idée est de proposer unes commandes pour créer des PixelArts \textit{collaboratifs}, pour former une \textit{grande} image à partir de plusieurs petites (de même taille). + +\smallskip + +{\footnotesize\faBomb} Pour des raisons pratiques (liées à l'utilisation de \texttt{filecontents}) le fichier \textsf{csv} doit finir par une ligne vide (elle est créée automatiquement via \texttt{filecontents}, et le code utilise cette spécificité). + +\smallskip + +Les \Cle{clés} disponibles sont exactement les mêmes que celles des affichages classiques. + +\smallskip + +L'exemple qui illustre cet aspect est issu d'un travail de Cyril IakoNelly, et représente un koala, dont le fichier \textsf{csv} a une taille 40×40 (ce qui permet un découpage \textit{facile}). + +\begin{filecontents*}[overwrite]{PAkoala.csv} +A,A,A,A,A,A,A,H,H,H,A,A,A,A,A,H,H,H,A,A,A,A,A,A,A,A,A,H,H,H,H,A,A,H,A,A,A,A,A,A +A,A,A,A,A,A,A,A,H,A,A,A,A,A,A,H,H,A,A,A,A,A,A,A,A,A,A,H,A,A,A,A,A,H,A,A,A,A,A,A +A,A,A,H,A,A,A,A,A,A,A,A,A,A,A,H,H,A,A,A,A,A,A,A,A,H,H,H,A,A,A,A,A,A,A,A,A,A,A,A +A,A,A,A,A,A,A,B,E,E,E,E,A,A,A,A,A,A,A,A,A,A,A,H,H,H,A,B,B,E,E,E,E,B,A,A,A,A,A,H +A,A,H,A,A,A,A,B,E,E,E,E,E,A,A,A,A,A,A,A,A,A,A,H,H,H,B,E,E,E,E,E,E,B,B,A,A,A,A,H +A,A,H,A,A,B,B,E,C,C,C,C,C,E,B,B,B,E,E,E,E,E,E,B,B,B,E,C,C,C,C,C,C,E,B,B,H,H,A,A +A,A,H,A,B,E,D,D,D,D,B,D,C,C,E,E,E,E,C,C,C,C,E,E,E,E,E,C,D,B,B,D,D,D,E,B,H,A,A,A +A,A,A,A,B,E,D,D,F,F,D,B,D,C,C,E,C,C,C,C,C,C,C,C,E,C,C,D,B,D,D,F,F,D,E,B,A,A,A,H +A,A,A,B,C,D,D,F,F,F,D,D,B,B,C,C,C,C,C,C,C,C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,H,H,I,B,B,D,D,D,D,D,C,C,B,D,D,B,C,C,C,D,D,D,D,B,I,I,A,A,A,A,A,A,A,A +A,A,H,H,H,A,A,A,I,I,I,B,B,B,D,B,B,B,B,B,B,B,B,B,B,D,B,B,B,I,I,I,A,A,A,A,A,A,H,A +A,A,H,H,H,A,A,A,A,I,I,I,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,I,I,I,A,A,A,A,A,A,A,H,A +H,H,A,H,H,A,A,A,A,A,A,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,A,A,A,A,A,A,A,A,A,A +A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,I,I,I,I,I,I,I,I,I,A,A,A,A,A,A,A,A,A,A,A,H,A,A,A,A +A,A,A,A,A,A,A,A,A,A,A,A,H,H,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,H,H,A,A,A,A +\end{filecontents*} + +\def\listcoulkoala{VertForet,Noir,GrisClair,GrisFonce,Beige,Blanc,BleuClair,VertClair,Marron} + +\begin{PresentationCode}{listing only} +\begin{filecontents*}[overwrite]{PAkoala.csv} +A,A,A,A,A,A,A,H,H,H,A,A,A,A,A,H,H,H,A,A,A,A,A,A,A,A,A,H,H,H,H,A,A,H,A,A,A,A,A,A +A,A,A,A,A,A,A,A,H,A,A,A,A,A,A,H,H,A,A,A,A,A,A,A,A,A,A,H,A,A,A,A,A,H,A,A,A,A,A,A +A,A,A,H,A,A,A,A,A,A,A,A,A,A,A,H,H,A,A,A,A,A,A,A,A,H,H,H,A,A,A,A,A,A,A,A,A,A,A,A +A,A,A,A,A,A,A,B,E,E,E,E,A,A,A,A,A,A,A,A,A,A,A,H,H,H,A,B,B,E,E,E,E,B,A,A,A,A,A,H +A,A,H,A,A,A,A,B,E,E,E,E,E,A,A,A,A,A,A,A,A,A,A,H,H,H,B,E,E,E,E,E,E,B,B,A,A,A,A,H +A,A,H,A,A,B,B,E,C,C,C,C,C,E,B,B,B,E,E,E,E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,A,A,I,B,D,C,C,C,C,C,C,C,G,G,F,F,G,G,C,C,C,C,C,C,C,D,B,I,A,A,A,A,A,A,A +A,A,A,A,A,A,A,I,B,D,D,D,C,C,C,B,B,B,G,G,G,G,B,B,B,C,C,C,D,D,D,B,I,A,A,A,A,A,A,A +A,A,A,A,A,H,A,I,I,B,D,D,D,D,D,C,C,C,B,D,D,B,C,C,C,C,D,D,D,B,B,I,I,A,A,A,A,A,A,A +A,A,A,A,A,H,H,H,I,B,B,D,D,D,D,D,C,C,B,D,D,B,C,C,C,D,D,D,D,B,I,I,A,A,A,A,A,A,A,A +A,A,H,H,H,A,A,A,I,I,I,B,B,B,D,B,B,B,B,B,B,B,B,B,B,D,B,B,B,I,I,I,A,A,A,A,A,A,H,A +A,A,H,H,H,A,A,A,A,I,I,I,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,I,I,I,A,A,A,A,A,A,A,H,A +H,H,A,H,H,A,A,A,A,A,A,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,A,A,A,A,A,A,A,A,A,A +A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,I,I,I,I,I,I,I,I,I,A,A,A,A,A,A,A,A,A,A,A,H,A,A,A,A +A,A,A,A,A,A,A,A,A,A,A,A,H,H,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,H,H,A,A,A,A +\end{filecontents*} + +%couleurs avec couleurs-fr +\def\listcoulkoala% + {VertForet,Noir,GrisClair,GrisFonce,Beige,Blanc,BleuClair,VertClair,Marron} +\end{PresentationCode} + +\subsection{Aide quant à la création du découpage} + +La première commande disponible est celle de l'affichage \textit{simplifié} de la grille de découpage (attention aux dimensions initiales pour un découpage \textit{idoine} !) + +La version étoilée affiche les grilles sous la forme \texttt{1.1}/\texttt{1.2}, etc. + +La version normale sous la forme \texttt{A1}, \texttt{A2}, etc. + +\smallskip + +L'argument \texttt{découpage} peut être donné sous la forme : +% +\begin{itemize} + \item \Cle{<nb lig bloc>x<nb col bloc>} pour spécifier la dimension des blocs ; + \item \Cle{<nb blocs V>+<nb blocs H>} pour spécifier le nombre de blocs. +\end{itemize} + +\begin{PresentationCode}{} +%découpage par blocs de taille 8x8 +\AideGrillePixelArtTikz{PAkoala.csv}{8x8} +~~ +\PixelArtTikz[Correction,Unite=0.125,Codes=ABCDEFGHI,Couleurs={\listcoulkoala},Decoupage=8x8]{PAkoala.csv} +\end{PresentationCode} + +\begin{PresentationCode}{} +%découpage par 4 blocs / ligne et 4 blocs / colonne +\AideGrillePixelArtTikz*[2]{PAkoala.csv}{4+4} +~~ +\PixelArtTikz[Correction,Unite=0.2,Codes=ABCDEFGHI,Couleurs={\listcoulkoala},Decoupage=4+4]{PAkoala.csv} +\end{PresentationCode} + +\newpage + +\subsection{Affichage d'une partie unique} + +Une commande est disponible pour l'affichage d'\textit{un} bloc particulier du PixelArt. + +Les clés sont héritées de celle des commandes principales. + +\begin{PresentationCode}{} +%bloc 1/1 pour un découpage 8x8 +\PixelArtTikzBloc[Unite=0.35,Codes=ABCDEFGHI]{PAkoala.csv}{8x8}{1/1} +~~ +\PixelArtTikzBloc[Unite=0.35,Codes=ABCDEFGHI,Correction,Couleurs={\listcoulkoala}]{PAkoala.csv}{8x8}{1/1} +\end{PresentationCode} + +\begin{PresentationCode}{} +%bloc 2/4 pour un découpage 4+4 +\PixelArtTikzBloc[Unite=0.35,Codes=ABCDEFGHI]{PAkoala.csv}{4+4}{2/4} +~~ +\PixelArtTikzBloc[Unite=0.35,Codes=ABCDEFGHI,Correction,Couleurs={\listcoulkoala}]{PAkoala.csv}{4+4}{2/4} +\end{PresentationCode} + +\smallskip + +L'idée est ensuite d'utiliser cette commande d'insertion d'\textit{un} bloc pour créer l'énoncé avec \textit{les} grilles de découpage. + +Mais il existe une commande de création \textit{automatique} des grilles découpées ! + +\newpage + +\subsection{Création automatique du découpage} + +Il existe également une commande dédiée pour le découpage automatique et la présentation automatique des petites grilles. + +\begin{PresentationCode}{} +%découpage par blocs de 8x8 +\DecoupPixelArtTikz[Unite=0.3,Codes=ABCDEFGHI]{PAkoala.csv}{8x8} +\end{PresentationCode} + +\pagebreak + +\begin{PresentationCode}{} +%découpage en4 blocs par 4 +\DecoupPixelArtTikz[Unite=0.3,Codes=ABCDEFGHI,Correction,Couleurs={\listcoulkoala}]{PAkoala.csv}{4+4} +\end{PresentationCode} + +\newpage + \section{La commande pour un \textit{mini-}PixelArt} \subsection{Idée} @@ -627,10 +845,119 @@ Le dernier argument, optionnel et entre \texttt{<...>}, permet quant à lui de p En ligne, on a \MiniPixelArt[Unite=5mm,Bord]{NBVOJV,JGP.NR}<baseline=(current bounding box.center)> ce miniPA. \end{PresentationCode} +\newpage + +\section{Création automatique du tableau notice} + +\subsection{Idée} + +L'idée est de proposer une commande pour créer automatiquement le tableau de notice, avec coloration des cases. + +\smallskip + +Le package utilisé est \texttt{tabularray}, et le code propose deux présentations du tableau, sous forme horizontal ou vertical (les tableaux sur plusieurs lignes ne sont pas gérés\ldots) + +\begin{PresentationCode}{listing only} +\TablCouleursPixelArt(*)[clés]{% + données1,% + données2,% + ... +} +\end{PresentationCode} + +Les \Cle{données} sont à mettre sous la forme \Cle{<NomCouleur>/<CodeCouleur>/<CouleurPolice>/<Résultat>}. + +\subsection{Clés et exemples} + +La version \textit{étoilée} force le tableau en mode vertical. + +\smallskip + +Les \Cle{clés} disponibles pour cette commande sont : + +\begin{itemize} + \item la clé \Cle{Largeur}, pour spécifier les informations de largeur : + \begin{itemize} + \item sous la forme \Cle{auto} pour les adapter aux contenus (valeur par défaut) ; + \item sous la forme \Cle{largeurglobale} en mode H (les cases auront la même largeur) ; + \item sous la forme \Cle{largeurcolonne} ou \Cle{largeurcolonne1/largeurcolonne2} en mode V ; + \end{itemize} + \item la clé \Cle{Police} spécifier une police particulière. +\end{itemize} + +\begin{PresentationCode}{} +%par défaut +\TablCouleursPixelArt{% + Marron/BrunIntense/Blanc/75,% + {Gris Clair}/GrisClair/Noir/{112,5},% + Vert Clair/VertClair/Noir/600,% + Noir/Noir/Blanc/9,% + Beige/Beige/Noir/15,% + Gris foncé/GrisFonce/Noir/{202,5},% + Bleu clair/BleuClair/Noir/288,% + Vert foncé/VertFonce/Blanc/10,% + Blanc/Blanc/Noir/55% +} +\end{PresentationCode} + +\begin{PresentationCode}{} +%personnalisations +\TablCouleursPixelArt[Largeur=\linewidth,Police=\small\sffamily]{% + Marron/BrunIntense/Blanc/75,% + {Gris Clair}/GrisClair/Noir/{112,5},% + Vert Clair/VertClair/Noir/600,% + Noir/Noir/Blanc/9,% + Beige/Beige/Noir/15,% + Gris foncé/GrisFonce/Noir/{202,5},% + Bleu clair/BleuClair/Noir/288,% + Vert foncé/VertFonce/Blanc/10,% + Blanc/Blanc/Noir/55% +} +\end{PresentationCode} + +\pagebreak + +\begin{PresentationCode}{} +%personnalisations +\TablCouleursPixelArt*[Largeur=3cm/]{% + Marron/BrunIntense/Blanc/75,% + {Gris Clair}/GrisClair/Noir/{112,5},% + Vert Clair/VertClair/Noir/600,% + Noir/Noir/Blanc/9,% + Beige/Beige/Noir/15,% + Gris foncé/GrisFonce/Noir/{202,5},% + Bleu clair/BleuClair/Noir/288,% + Vert foncé/VertFonce/Blanc/10,% + Blanc/Blanc/Noir/55% +} +\end{PresentationCode} + +\subsection{Commande simplifiée (??) pour les cases} + +Il est également possible de créer le tableau \textit{manuellement}, avec une commande \textit{simplifiée} pour la création des cases. + +\begin{PresentationCode}{listing only} +%dans un environnement tblr, chargé avec [expand=\expanded] et \expanded ! +\cctblr[couleur police]{couleur fond}{case} +\end{PresentationCode} + +\begin{PresentationCode}{} +\begin{tblr}[expand=\expanded]{width=\linewidth,colspec={*{5}{Q[m,l]}},hlines,vlines} + \expanded{\cctblr[Blanc]{BrunIntense}{Marron}} & + \expanded{\cctblr{GrisClair}{Gris clair}} & + \expanded{\cctblr{VertClair}{Vert clair}} & + \expanded{\cctblr[Blanc]{Noir}{Noir}} & + \ldots \\ + 75 & {112,5} & 600 & 9 & \ldots \\ +\end{tblr} +\end{PresentationCode} + \pagebreak \part{Historique} +\verb|v0.1.3|~:~~~~Possibilité de créer des PixelArts collaboratifs + \verb|v0.1.2|~:~~~~Possibilité de créer des \textit{mini-}PixelArts \verb|v0.1.1|~:~~~~Correction d'un bug avec les couleurs diff --git a/graphics/pgf/contrib/pixelarttikz/tex/PixelArtTikz.sty b/graphics/pgf/contrib/pixelarttikz/tex/PixelArtTikz.sty index e05a66fb5a..882b1ecffa 100644 --- a/graphics/pgf/contrib/pixelarttikz/tex/PixelArtTikz.sty +++ b/graphics/pgf/contrib/pixelarttikz/tex/PixelArtTikz.sty @@ -2,7 +2,8 @@ % licence........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{PixelArtTikz}[2023/10/12 v0.1.2 PixelArts with csv and TikZ] +\ProvidesPackage{PixelArtTikz}[2024/04/11 v0.1.3 PixelArts with csv and TikZ] +% 0.1.3 Split PA into grid % 0.1.2 Mini pixerlart % 0.1.1 Small bugfix with color % 0.1.0 Version initiale @@ -20,6 +21,7 @@ \RequirePackage{xintexpr} \RequirePackage{xinttools} \RequirePackage{xstring} +\RequirePackage{multicol} \RequirePackage{listofitems} %librairies tikz %\usetikzlibrary{calc,shapes.geometric} @@ -37,7 +39,8 @@ Couleurs=\def\PATcouleurs{#1},% Symboles=\def\PATchiffres{#1},% Style=\def\PATtaille{#1},% - Unite=\def\PATunit{#1} + Unite=\def\PATunit{#1},% + Decoupage=\def\PATdecoup{#1} } \setKVdefault[pixelarttkz]{% @@ -45,7 +48,8 @@ Correction=false,% Symb=false,% BordCases=true,% - Unite=1 + Unite=1,% + Decoupage={} } %----[fr] commands @@ -58,9 +62,9 @@ {% \csvloop{file=#4,no head,command={% \foreach \l [count=\n] in \csvline {% - \StrDel{\l}{ }[\l] - \setsepchar{,} - \readlist*\LCPA\PATcouleurs + \StrDel{\l}{ }[\l]% + \setsepchar{,}% + \readlist*\LCPA\PATcouleurs% \StrPosition{\PATlettres}{\l}[\pixcnt]% \xintifboolexpr{\pixcnt>0}% {% @@ -78,9 +82,9 @@ \ifboolKV[pixelarttkz]{Symb}{%affichage du pixelart versions chiffres si besoin \csvloop{file=#4,no head,command={% \foreach \l [count=\n] in \csvline {% - \StrDel{\l}{ }[\l] - \setsepchar{,} - \readlist*\LCNA\PATchiffres + \StrDel{\l}{ }[\l]% + \setsepchar{,}% + \readlist*\LCNA\PATchiffres% \StrPosition{\PATlettres}{\l}[\pixpos]% \xintifboolexpr{\pixpos>0}% {% @@ -95,7 +99,7 @@ {%affichage du pixelart versions lettres ou chiffres simples (<=9) / display of letters/symbols PixelArt \csvloop{file=#4,no head,command={% \foreach \l [count=\n] in \csvline {% - \StrDel{\l}{ }[\l] + \StrDel{\l}{ }[\l]% \IfSubStr{\PATlettres}{\l}% {% \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\l};% @@ -106,6 +110,30 @@ }% }% }% + %affichage des découpages éventuels + \IfStrEq{\PATdecoup}{}% + {}% + {% + \csvreader{#4}{}{}%en test + \xdef\NbLigTot{\thecsvinputline}% + \xdef\NbColTot{\thecsvcolumncount}% + \IfSubStr{\PATdecoup}{x}% + {% + \StrCut{\PATdecoup}{x}{\NbLigBloc}{\NbColBloc}%tracés des traits + \foreach \i in {0,\NbLigBloc,...,\NbLigTot}{\draw[thick,purple] ({0.5-0.33},{-\i-0.5}) -- ({\thecsvcolumncount+0.5+0.33},{-\i-0.5}) ;}% + \foreach \j in {0,\NbColBloc,...,\NbColTot}{\draw[thick,purple] ({\j+0.5},{-0.5+0.33}) -- ({\j+0.5},{-\thecsvinputline+0.5-0.33}) ;}% + }% + {}% + \IfSubStr{\PATdecoup}{+}% + {% + \StrCut{\PATdecoup}{+}{\NbBlocLIG}{\NbBlocCOL}% + \def\NbLigBloc{\xintieval{(\NbLigTot-1)/\NbBlocLIG}}% + \def\NbColBloc{\xintieval{(\NbColTot)/\NbBlocCOL}}% + \foreach \i in {0,\NbLigBloc,...,\NbLigTot}{\draw[thick,purple] ({0.5-0.33},{-\i-0.5}) -- ({\thecsvcolumncount+0.5+0.33},{-\i-0.5}) ;}% + \foreach \j in {0,\NbColBloc,...,\NbColTot}{\draw[thick,purple] ({\j+0.5},{-0.5+0.33}) -- ({\j+0.5},{-\thecsvinputline+0.5-0.33}) ;}% + }% + {}% + }% \IfBooleanTF{#1}{}{\end{tikzpicture}}% } @@ -119,9 +147,9 @@ {% \csvloop{file=#3,no head,command={% \foreach \l [count=\n] in \csvline {% - \StrDel{\l}{ }[\l] - \setsepchar{,} - \readlist*\LCPA\PATcouleurs + \StrDel{\l}{ }[\l]% + \setsepchar{,}% + \readlist*\LCPA\PATcouleursù \StrPosition{\PATlettres}{\l}[\pixcnt]% \xintifboolexpr{\pixcnt>0}% {% @@ -139,9 +167,9 @@ \ifboolKV[pixelarttkz]{Symb}{%affichage du pixelart versions chiffres si besoin \csvloop{file=#3,no head,command={% \foreach \l [count=\n] in \csvline {% - \StrDel{\l}{ }[\l] - \setsepchar{,} - \readlist*\LCNA\PATchiffres + \StrDel{\l}{ }[\l]% + \setsepchar{,}% + \readlist*\LCNA\PATchiffres% \StrPosition{\PATlettres}{\l}[\pixpos]% \xintifboolexpr{\pixpos>0}% {% @@ -156,7 +184,7 @@ {%affichage du pixelart versions lettres ou chiffres simples (<=9) / display of letters/symbols PixelArt \csvloop{file=#3,no head,command={% \foreach \l [count=\n] in \csvline {% - \StrDel{\l}{ }[\l] + \StrDel{\l}{ }[\l]% \IfSubStr{\PATlettres}{\l}% {% \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\l};% @@ -178,7 +206,8 @@ Colors=\def\PATcouleurs{#1},% Symbols=\def\PATchiffres{#1},% Style=\def\PATtaille{#1},% - Unit=\def\PATunit{#1} + Unit=\def\PATunit{#1},% + Grid=\def\PATdecoup{#1} } \setKVdefault[pixelarttkzen]{% @@ -186,7 +215,8 @@ Correction=false,% Symb=false,% Border=true,% - Unit=1 + Unit=1,% + Grid={} } \NewDocumentCommand\PixlArtTikz{ s O{} D<>{} m }{%commande autonome @@ -198,9 +228,9 @@ {% \csvloop{file=#4,no head,command={% \foreach \l [count=\n] in \csvline {% - \StrDel{\l}{ }[\l] - \setsepchar{,} - \readlist*\LCPA\PATcouleurs + \StrDel{\l}{ }[\l]% + \setsepchar{,}% + \readlist*\LCPA\PATcouleurs% \StrPosition{\PATlettres}{\l}[\pixcnt]% \xintifboolexpr{\pixcnt>0}% {% @@ -218,9 +248,9 @@ \ifboolKV[pixelarttkzen]{Symb}{%affichage du pixelart versions chiffres si besoin \csvloop{file=#4,no head,command={% \foreach \l [count=\n] in \csvline {% - \StrDel{\l}{ }[\l] - \setsepchar{,} - \readlist*\LCNA\PATchiffres + \StrDel{\l}{ }[\l]% + \setsepchar{,}% + \readlist*\LCNA\PATchiffres% \StrPosition{\PATlettres}{\l}[\pixpos]% \xintifboolexpr{\pixpos>0}% {% @@ -235,7 +265,7 @@ {%affichage du pixelart versions lettres ou chiffres simples (<=9) / display of letters/symbols PixelArt \csvloop{file=#4,no head,command={% \foreach \l [count=\n] in \csvline {% - \StrDel{\l}{ }[\l] + \StrDel{\l}{ }[\l]% \IfSubStr{\PATlettres}{\l}% {% \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\l};% @@ -246,7 +276,31 @@ }% }% }% - \IfBooleanTF{#1}{}{\end{tikzpicture}}% + %affichage des découpages éventuels + \IfStrEq{\PATdecoup}{}% + {}% + {% + \csvreader{#4}{}{}%en test + \xdef\NbLigTot{\thecsvinputline}% + \xdef\NbColTot{\thecsvcolumncount}% + \IfSubStr{\PATdecoup}{x}% + {% + \StrCut{\PATdecoup}{x}{\NbLigBloc}{\NbColBloc}%tracés des traits + \foreach \i in {0,\NbLigBloc,...,\NbLigTot}{\draw[thick,purple] ({0.5-0.33},{-\i-0.5}) -- ({\thecsvcolumncount+0.5+0.33},{-\i-0.5}) ;}% + \foreach \j in {0,\NbColBloc,...,\NbColTot}{\draw[thick,purple] ({\j+0.5},{-0.5+0.33}) -- ({\j+0.5},{-\thecsvinputline+0.5-0.33}) ;}% + }% + {}% + \IfSubStr{\PATdecoup}{+}% + {% + \StrCut{\PATdecoup}{+}{\NbBlocLIG}{\NbBlocCOL}% + \def\NbLigBloc{\xintieval{(\NbLigTot-1)/\NbBlocLIG}}% + \def\NbColBloc{\xintieval{(\NbColTot)/\NbBlocCOL}}% + \foreach \i in {0,\NbLigBloc,...,\NbLigTot}{\draw[thick,purple] ({0.5-0.33},{-\i-0.5}) -- ({\thecsvcolumncount+0.5+0.33},{-\i-0.5}) ;}% + \foreach \j in {0,\NbColBloc,...,\NbColTot}{\draw[thick,purple] ({\j+0.5},{-0.5+0.33}) -- ({\j+0.5},{-\thecsvinputline+0.5-0.33}) ;}% + }% + {}% + }% + \IfBooleanTF{#1}{}{\end{tikzpicture}}% } \NewDocumentEnvironment{EnvPixlArtTikz}{ O{} D<>{} m }%environnement @@ -259,9 +313,9 @@ {% \csvloop{file=#3,no head,command={% \foreach \l [count=\n] in \csvline {% - \StrDel{\l}{ }[\l] - \setsepchar{,} - \readlist*\LCPA\PATcouleurs + \StrDel{\l}{ }[\l]% + \setsepchar{,}% + \readlist*\LCPA\PATcouleurs% \StrPosition{\PATlettres}{\l}[\pixcnt]% \xintifboolexpr{\pixcnt>0}% {% @@ -279,9 +333,9 @@ \ifboolKV[pixelarttkzen]{Symb}{%affichage du pixelart versions chiffres si besoin \csvloop{file=#3,no head,command={% \foreach \l [count=\n] in \csvline {% - \StrDel{\l}{ }[\l] - \setsepchar{,} - \readlist*\LCNA\PATchiffres + \StrDel{\l}{ }[\l]% + \setsepchar{,}% + \readlist*\LCNA\PATchiffres% \StrPosition{\PATlettres}{\l}[\pixpos]% \xintifboolexpr{\pixpos>0}% {% @@ -296,7 +350,7 @@ {%affichage du pixelart versions lettres ou chiffres simples (<=9) / display of letters/symbols PixelArt \csvloop{file=#3,no head,command={% \foreach \l [count=\n] in \csvline {% - \StrDel{\l}{ }[\l] + \StrDel{\l}{ }[\l]% \IfSubStr{\PATlettres}{\l}% {% \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\l};% @@ -307,8 +361,8 @@ }% }% }% - }% - {% +}% +{% \end{tikzpicture}% }% @@ -392,5 +446,406 @@ \end{tikzpicture}% } +%----découpage [fr] +\NewDocumentCommand\PixelArtTikzBloc{ O{} D<>{} m m m }{%commande individuelle + %3=fichier + %4=taille blocs (LxC) ou nombre de blocs (L+C) + %5=numbloc + %dernier argument := bloc + \useKVdefault[pixelarttkz]% + \setKV[pixelarttkz]{#1}% + \csvreader{#3}{}{}%en test + \xdef\NbLigTot{\thecsvinputline}% + \xdef\NbColTot{\thecsvcolumncount}% + \IfSubStr{#4}{x}% + {% + \StrCut{#4}{x}{\NbLigBloc}{\NbColBloc}% + }% + {}% + \IfSubStr{#4}{+}% + {% + \StrCut{#4}{+}{\NbBlocLIG}{\NbBlocCOL}% + \xdef\NbLigBloc{\xinteval{(\NbLigTot-1)/\NbBlocLIG}}% + \xdef\NbColBloc{\xinteval{(\NbColTot)/\NbBlocCOL}}% + }% + {}% + \StrCut{#5}{/}{\NumBlocLig}{\NumBlocCol}% + \xdef\PAfirstline{\xinteval{\NbLigBloc*(\NumBlocLig-1)+1}}% + \xdef\PAlastline{\xinteval{\NbLigBloc*(\NumBlocLig-1)+\NbLigBloc}}% + %affichage du corrigé / display of correction + \begin{tikzpicture}[x=\PATunit cm,y=\PATunit cm,#2] + \ifboolKV[pixelarttkz]{Correction}% + {% + \csvloop{file=#3,range=\PAfirstline-\PAlastline,no head,command={% + \foreach \l [count=\n] in \csvline {% + \xintifboolexpr{ \n >= (\NbColBloc*(\NumBlocCol-1)+1) 'and' \n <= (\NbColBloc*(\NumBlocCol-1)+\NbColBloc)}% + {% + \StrDel{\l}{ }[\l]% + \setsepchar{,}% + \readlist*\LCPA\PATcouleurs% + \StrPosition{\PATlettres}{\l}[\pixcnt]% + \xintifboolexpr{\pixcnt>0}% + {% + \itemtomacro\LCPA[\pixcnt]\pixcol% + \ifboolKV[pixelarttkz]{BordCases}% + {\draw[fill=\pixcol] ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) ;}% + {\filldraw[\pixcol] ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) ;}% + }% + {}% + }% + {}% + }% + }% + }% + }% + {% + \ifboolKV[pixelarttkz]{Symb}{%affichage du pixelart versions chiffres si besoin + \csvloop{file=#3,range=\PAfirstline-\PAlastline,no head,command={% + \foreach \l [count=\n] in \csvline {% + \xintifboolexpr{ \n >= (\NbColBloc*(\NumBlocCol-1)+1) 'and' \n <= (\NbColBloc*(\NumBlocCol-1)+\NbColBloc)}% + {% + \StrDel{\l}{ }[\l]% + \setsepchar{,}% + \readlist*\LCNA\PATchiffres% + \StrPosition{\PATlettres}{\l}[\pixpos]% + \xintifboolexpr{\pixpos>0}% + {% + \itemtomacro\LCNA[\pixpos]\pixchf% + \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\pixchf} ;% + }% + {}% + }% + {}% + }% + }% + }% + }% + {%affichage du pixelart versions lettres ou chiffres simples (<=9) / display of letters/symbols PixelArt + \csvloop{file=#3,range=\PAfirstline-\PAlastline,no head,command={% + \foreach \l [count=\n] in \csvline {% + \xintifboolexpr{ \n >= (\NbColBloc*(\NumBlocCol-1)+1) 'and' \n <= (\NbColBloc*(\NumBlocCol-1)+\NbColBloc)}% + {% + \StrDel{\l}{ }[\l]% + \IfSubStr{\PATlettres}{\l}% + {% + \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\l};% + }% + {}% + }% + {}% + }% + }% + }% + }% + }% + \end{tikzpicture}% +} + +\def\PAalphabet{ABCDEFGHIJKLMNOPQRSTUVWXYZ} + +\NewDocumentCommand\DecoupPixelArtTikz{ s O{} D<>{} m m }{%commande de découpage global + %(*)=lettre pour les lignes + %1=clés globales + %2=options tikz + %3=fichier + %4=taille blocs LxC ou L+C + \csvreader{#4}{}{}%en test + \IfSubStr{#5}{x}% + {% + \StrCut{#5}{x}{\NbLigBloc}{\NbColBloc}% + \xdef\NbTotLig{\xintieval{(\thecsvinputline-1)/\NbLigBloc}}% + \xdef\NbTotCol{\xintieval{(\thecsvcolumncount)/\NbLigBloc}}% + }% + {}% + \IfSubStr{#5}{+}% + {% + \StrCut{#5}{+}{\NbTotLig}{\NbTotCol}% + }% + {}% + \xintFor* ##1 in {\xintSeq{1}{\NbTotLig}}\do{% + \begin{tabular}{*{\NbTotCol}{c}} + \xintFor* ##2 in {\xintSeq{1}{\NbTotCol-1}}\do{% + Grille \IfBooleanTF{#1}{##1.}{\StrChar{\PAalphabet}{##1}}##2 & + } + Grille \IfBooleanTF{#1}{##1.}{\StrChar{\PAalphabet}{##1}}\NbTotCol \\ + \xintFor* ##2 in {\xintSeq{1}{\NbTotCol-1}}\do{% + \PixelArtTikzBloc[#2]<#3>{#4}{#5}{##1/##2}& + } + \PixelArtTikzBloc[#2]<#3>{#4}{#5}{##1/\NbTotCol}\\ + \end{tabular}\xintifboolexpr{##1 == \NbTotLig}{}{\\} + }% +} + +\NewDocumentCommand\AideGrillePixelArtTikz{ s O{1} m m }{%création de la grille d'aide + \csvreader{#3}{}{}%en test + \IfSubStr{#4}{x}% + {% + \StrCut{#4}{x}{\NbLigBloc}{\NbColBloc}% + \xdef\NbTotLig{\xintieval{(\thecsvinputline-1)/\NbLigBloc}}% + \xdef\NbTotCol{\xintieval{(\thecsvcolumncount)/\NbLigBloc}}% + }% + {}% + \IfSubStr{#4}{+}% + {% + \StrCut{#4}{+}{\NbTotLig}{\NbTotCol}% + }% + {}% + \begin{tikzpicture}[scale=#2,transform shape] + \xintFor* ##1 in {\xintSeq{1}{\NbTotLig}}\do{% + \xintFor* ##2 in {\xintSeq{1}{\NbTotCol}}\do{% + \draw[semithick] (##2,-##1) rectangle++(1,-1) node[midway] {\IfBooleanTF{#1}{##1.}{\StrChar{\PAalphabet}{##1}}##2} ; + }% + }% + \end{tikzpicture}% +} + +%----découpage [en] +\NewDocumentCommand\PixlArtTikzBlock{ O{} D<>{} m m m }{%commande individuelle + %3=fichier + %4=taille blocs (LxC) ou nombre de blocs (L+C) + %5=numbloc + %dernier argument := bloc + \useKVdefault[pixelarttkzen]% + \setKV[pixelarttkzen]{#1}% + \csvreader{#3}{}{}%en test + \xdef\NbLigTot{\thecsvinputline}% + \xdef\NbColTot{\thecsvcolumncount}% + \IfSubStr{#4}{x}% + {% + \StrCut{#4}{x}{\NbLigBloc}{\NbColBloc}% + }% + {}% + \IfSubStr{#4}{+}% + {% + \StrCut{#4}{+}{\NbBlocLIG}{\NbBlocCOL}% + \xdef\NbLigBloc{\xinteval{(\NbLigTot-1)/\NbBlocLIG}}% + \xdef\NbColBloc{\xinteval{(\NbColTot)/\NbBlocCOL}}% + }% + {}% + \StrCut{#5}{/}{\NumBlocLig}{\NumBlocCol}% + \xdef\PAfirstline{\xinteval{\NbLigBloc*(\NumBlocLig-1)+1}}% + \xdef\PAlastline{\xinteval{\NbLigBloc*(\NumBlocLig-1)+\NbLigBloc}}% + %affichage du corrigé / display of correction + \begin{tikzpicture}[x=\PATunit cm,y=\PATunit cm,#2] + \ifboolKV[pixelarttkzen]{Correction}% + {% + \csvloop{file=#3,range=\PAfirstline-\PAlastline,no head,command={% + \foreach \l [count=\n] in \csvline {% + \xintifboolexpr{ \n >= (\NbColBloc*(\NumBlocCol-1)+1) 'and' \n <= (\NbColBloc*(\NumBlocCol-1)+\NbColBloc)}% + {% + \StrDel{\l}{ }[\l]% + \setsepchar{,}% + \readlist*\LCPA\PATcouleurs% + \StrPosition{\PATlettres}{\l}[\pixcnt]% + \xintifboolexpr{\pixcnt>0}% + {% + \itemtomacro\LCPA[\pixcnt]\pixcol% + \ifboolKV[pixelarttkzen]{Border}% + {\draw[fill=\pixcol] ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) ;}% + {\filldraw[\pixcol] ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) ;}% + }% + {}% + }% + {}% + }% + }% + }% + }% + {% + \ifboolKV[pixelarttkzen]{Symb}{%affichage du pixelart versions chiffres si besoin + \csvloop{file=#3,range=\PAfirstline-\PAlastline,no head,command={% + \foreach \l [count=\n] in \csvline {% + \xintifboolexpr{ \n >= (\NbColBloc*(\NumBlocCol-1)+1) 'and' \n <= (\NbColBloc*(\NumBlocCol-1)+\NbColBloc)}% + {% + \StrDel{\l}{ }[\l]% + \setsepchar{,}% + \readlist*\LCNA\PATchiffres% + \StrPosition{\PATlettres}{\l}[\pixpos]% + \xintifboolexpr{\pixpos>0}% + {% + \itemtomacro\LCNA[\pixpos]\pixchf% + \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\pixchf} ;% + }% + {}% + }% + {}% + }% + }% + }% + }% + {%affichage du pixelart versions lettres ou chiffres simples (<=9) / display of letters/symbols PixelArt + \csvloop{file=#3,range=\PAfirstline-\PAlastline,no head,command={% + \foreach \l [count=\n] in \csvline {% + \xintifboolexpr{ \n >= (\NbColBloc*(\NumBlocCol-1)+1) 'and' \n <= (\NbColBloc*(\NumBlocCol-1)+\NbColBloc)}% + {% + \StrDel{\l}{ }[\l]% + \IfSubStr{\PATlettres}{\l}% + {% + \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\l};% + }% + {}% + }% + {}% + }% + }% + }% + }% + }% + \end{tikzpicture}% +} + +\NewDocumentCommand\CutPixlArtTikz{ s O{} D<>{} m m }{%commande de découpage global + %(*)=lettre pour les lignes + %1=clés globales + %2=options tikz + %3=fichier + %4=taille blocs LxC ou L+C + \csvreader{#4}{}{}%en test + \IfSubStr{#5}{x}% + {% + \StrCut{#5}{x}{\NbLigBloc}{\NbColBloc}% + \xdef\NbTotLig{\xintieval{(\thecsvinputline-1)/\NbLigBloc}}% + \xdef\NbTotCol{\xintieval{(\thecsvcolumncount)/\NbLigBloc}}% + }% + {}% + \IfSubStr{#5}{+}% + {% + \StrCut{#5}{+}{\NbTotLig}{\NbTotCol}% + }% + {}% + \xintFor* ##1 in {\xintSeq{1}{\NbTotLig}}\do{% + \begin{tabular}{*{\NbTotCol}{c}} + \xintFor* ##2 in {\xintSeq{1}{\NbTotCol-1}}\do{% + Sample \IfBooleanTF{#1}{##1.}{\StrChar{\PAalphabet}{##1}}##2 & + } + Sample \IfBooleanTF{#1}{##1.}{\StrChar{\PAalphabet}{##1}}\NbTotCol \\ + \xintFor* ##2 in {\xintSeq{1}{\NbTotCol-1}}\do{% + \PixlArtTikzBlock[#2]<#3>{#4}{#5}{##1/##2}& + } + \PixlArtTikzBlock[#2]<#3>{#4}{#5}{##1/\NbTotCol}\\ + \end{tabular}\xintifboolexpr{##1 == \NbTotLig}{}{\\} + }% +} + +\NewDocumentCommand\HelpGridPixelArtTikz{ s O{1} m m }{%création de la grille d'aide + \csvreader{#3}{}{}%en test + \IfSubStr{#4}{x}% + {% + \StrCut{#4}{x}{\NbLigBloc}{\NbColBloc}% + \xdef\NbTotLig{\xintieval{(\thecsvinputline-1)/\NbLigBloc}}% + \xdef\NbTotCol{\xintieval{(\thecsvcolumncount)/\NbLigBloc}}% + }% + {}% + \IfSubStr{#4}{+}% + {% + \StrCut{#4}{+}{\NbTotLig}{\NbTotCol}% + }% + {}% + \begin{tikzpicture}[scale=#2,transform shape] + \xintFor* ##1 in {\xintSeq{1}{\NbTotLig}}\do{% + \xintFor* ##2 in {\xintSeq{1}{\NbTotCol}}\do{ + \draw[semithick] (##2,-##1) rectangle++(1,-1) node[midway] {\IfBooleanTF{#1}{##1.}{\StrChar{\PAalphabet}{##1}}##2} ; + }% + }% + \end{tikzpicture}% +} + +%====TABLEAU AUTOMATIQUE DES COULEURS (expérimental) +\RequirePackage{tabularray} + +\defKV[TableCouleursPA]{% + Police=\def\PAtablfonte{#1},% + Largeur=\def\PAtabllarg{#1} +} +\setKVdefault[TableCouleursPA]{% + Police={\normalsize\normalfont},% + Largeur=auto +} + +\NewDocumentCommand\TablCouleursPixelArt{ s O{} D<>{} m }{% + \restoreKV[TableCouleursPA]% + \setKV[TableCouleursPA]{#2}% + \def\runlistcolors{#4}% + \readlist*\ListeCoulCases{#4}% + \def\PAtablenotice{}% + \IfBooleanTF{#1}% + {% + \foreach \AAAA/\BBBB/\CCCC/\DDDD [count=\i] in \runlistcolors{% + \xdef\PAtablenotice{\PAtablenotice \SetCell{bg=\BBBB,fg=\CCCC}\AAAA & \DDDD \\} + }% + \IfStrEq{\PAtabllarg}{auto}% + {% + \begin{tblr}[expand=\PAtablenotice]{hlines,vlines,colspec={*{2}{Q[m,c]}},cells={font=\PAtablfonte},#3} + \PAtablenotice + \end{tblr}% + }% + {% + \IfSubStr{\PAtabllarg}{/}% + {% + \StrCut{\PAtabllarg}{/}{\tmpLargColA}{\tmpLargColB}% + \IfStrEq{\tmpLargColA}{}% + {% + \IfStrEq{\tmpLargColB}{}% + {% + \begin{tblr}[expand=\PAtablenotice]{hlines,vlines,colspec={Q[m,c]Q[m,c]},cells={font=\PAtablfonte},#3} + \PAtablenotice + \end{tblr}% + }% + {% + \begin{tblr}[expand=\PAtablenotice]{hlines,vlines,colspec={Q[m,c]Q[m,c,\tmpLargColB]},cells={font=\PAtablfonte},#3} + \PAtablenotice + \end{tblr}% + }% + }% + {% + \IfStrEq{\tmpLargColB}{}% + {% + \begin{tblr}[expand=\PAtablenotice]{hlines,vlines,colspec={Q[m,c,\tmpLargColA]Q[m,c]},cells={font=\PAtablfonte},#3} + \PAtablenotice + \end{tblr}% + }% + {% + \begin{tblr}[expand=\PAtablenotice]{hlines,vlines,colspec={Q[m,c,\tmpLargColA]Q[m,c,\tmpLargColB]},cells={font=\PAtablfonte},#3} + \PAtablenotice + \end{tblr}% + }% + }% + }% + {% + \begin{tblr}[expand=\PAtablenotice]{width=\PAtabllarg,hlines,vlines,colspec={*{2}{X[m,c]}},cells={font=\PAtablfonte},#3} + \PAtablenotice + \end{tblr}% + }% + }% + }% + {% + \foreach \AAAA/\BBBB/\CCCC/\DDDD [count=\i] in \runlistcolors{% + \xdef\PAtablenotice{\PAtablenotice \SetCell{bg=\BBBB,fg=\CCCC}\AAAA \xintifboolexpr{\i == \ListeCoulCaseslen}{\\}{&}} + }% + \foreach \AAAA/\BBBB/\CCCC/\DDDD [count=\i] in \runlistcolors{% + \xdef\PAtablenotice{\PAtablenotice {\DDDD} \xintifboolexpr{\i == \ListeCoulCaseslen}{\\}{&}} + }% + \IfStrEq{\PAtabllarg}{auto}% + {% + \begin{tblr}[expand=\PAtablenotice]{hlines,vlines,colspec={*{\ListeCoulCaseslen}{Q[m,c]}},cells={font=\PAtablfonte},#3} + \PAtablenotice + \end{tblr}% + }% + {% + \begin{tblr}[expand=\PAtablenotice]{width=\PAtabllarg,hlines,vlines,colspec={*{\ListeCoulCaseslen}{X[m,c]}},cells={font=\PAtablfonte},#3} + \PAtablenotice + \end{tblr}% + }% + }% +} + +%====COMMANDE SIMPLIFIÉE tabularray +\NewExpandableDocumentCommand\cctblr{ O{black} m m }{% + %1=couleur police + %2=couleur case + %3=case + \SetCell{bg=#2,fg=#1}#3 +} + \endinput
\ No newline at end of file |