texlive[76088] Master/texmf-dist: tikzbrickfigurines (18aug25)

commits+karl at tug.org commits+karl at tug.org
Mon Aug 18 21:02:37 CEST 2025


Revision: 76088
          https://tug.org/svn/texlive?view=revision&revision=76088
Author:   karl
Date:     2025-08-18 21:02:37 +0200 (Mon, 18 Aug 2025)
Log Message:
-----------
tikzbrickfigurines (18aug25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/tikzbrickfigurines/tikzbrickfigurines-doc.pdf
    trunk/Master/texmf-dist/doc/latex/tikzbrickfigurines/tikzbrickfigurines-doc.tex
    trunk/Master/texmf-dist/tex/latex/tikzbrickfigurines/tikzbrickfigurines.sty

Modified: trunk/Master/texmf-dist/doc/latex/tikzbrickfigurines/tikzbrickfigurines-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tikzbrickfigurines/tikzbrickfigurines-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikzbrickfigurines/tikzbrickfigurines-doc.tex	2025-08-18 19:02:24 UTC (rev 76087)
+++ trunk/Master/texmf-dist/doc/latex/tikzbrickfigurines/tikzbrickfigurines-doc.tex	2025-08-18 19:02:37 UTC (rev 76088)
@@ -17,7 +17,7 @@
 \renewcommand{\headrulewidth}{0pt}
 \lfoot{\sffamily\small [tikzbrickfigurines]}
 \cfoot{%
-	\raisebox{-1.75em}{\minitikzbrickfigurine[color sweat=white,display logo,logo={\bfseries\sffamily\color{black}{\thepage}}]{3.5em}{*}}
+	\raisebox{-1.75em}{\minitikzbrickfigurine[color sweat=white,display logo,scale logo=0.5,logo={\footnotesize\bfseries\sffamily\color{black}{\thepage}}]{3.5em}{*}}
 }
 \rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}}
 \usepackage{hologo}
@@ -40,8 +40,8 @@
 \hypersetup{pdfborder=0 0 0}
 \usepackage[margin=2cm,includefoot]{geometry}
 \setlength{\parindent}{0pt}
-\def\TPversion{0.1.0}
-\def\TPdate{12/08/2025}
+\def\TPversion{0.1.1}
+\def\TPdate{18/08/2025}
 \usepackage{enumitem}
 \usepackage{openmoji}
 \usepackage{tcolorbox}
@@ -238,6 +238,8 @@
 
 \section{History}
 
+\texttt{0.1.1: Enhancements for adjusted logo}
+
 \texttt{0.1.0: Initial version}
 
 \vspace*{5mm}
@@ -254,7 +256,7 @@
 \usepackage{tikzbrickfigurines}
 \end{DemoCode}
 
-Loaded packages are \ShowCode{tikz}, \ShowCode{simplekv}, \ShowCode{xstring}, \ShowCode{ifthen}, \ShowCode{listofitems}, \ShowCode{graphicx} and \ShowCode{calc}.
+Loaded packages are \ShowCode{tikz}, \ShowCode{simplekv}, \ShowCode{xstring}, \ShowCode{ifthen}, \ShowCode{listofitems}, \ShowCode{graphicx}, \ShowCode{etoolbox} and \ShowCode{calc}.
 
 Loaded libraries are \ShowCode{shapes.geometric,bbox,decorations,decorations.pathmorphing,calc}.
 
@@ -264,7 +266,7 @@
 
 \begin{itemize}
 	\item to manipulate these elements with a \ShowCode{pic} code;
-	\item to improve the code for the logo.
+	\item to improve the code for the logo (work in progress).
 \end{itemize}
 
 
@@ -349,6 +351,7 @@
 	\item \ShowCode{color top pant}: simple color for top pant (\ShowCode[orange!15]{blue!75})
 	\item \ShowCode{color middle pant}: simple color for mid pant (\ShowCode[orange!15]{blue!75})
 	\item \ShowCode{color foot}: simple color for shoes (\ShowCode[orange!15]{darkgray!50!black})
+	\item \ShowCode{adjusted logo}: the logo will be adjusted to sweat
 	\item \ShowCode{display logo}: boolean for logo (\ShowCode[orange!15]{false})
 	\item \ShowCode{custom logo}: boolean for custom logo (\ShowCode[orange!15]{false})
 	\item \ShowCode{logo}: code for the optional logo
@@ -481,6 +484,52 @@
 	\tikzbrickfigurinepiece{head=10/10/10/2}{2in}
 \end{tblr}
 
+\subsection{The optional logo}
+
+Due to scaling process, a global scale is applied to whole figure (with the \TikZ\ option \ShowCode{transform shape}). So every node is scaled too.
+
+The special key \ShowCode{scale logo=...} can adjust most precisely the logo!
+
+\smallskip
+
+There's three methods in order to place a logo:
+
+\begin{itemize}
+	\item boolean \ShowCode{custom logo} and key \ShowCode{logo=...} with the same global scale;
+	\item boolean \ShowCode{display logo} and key \ShowCode{logo=...} with a \textit{cancel} scale;
+	\item key \ShowCode{adjusted logo=...} to adjust in the sweat.
+\end{itemize}
+
+\def\mylogo{%
+	\sffamily\rotatebox{30}{%
+		\begin{tabular}{@{}c@{}}%
+			\faPython\ I'm a \\ Python \\ user \faPython
+		\end{tabular}%
+	}%
+}
+
+\begin{DemoCode}{}
+\def\mylogo{\sffamily\rotatebox{30}{%
+  \begin{tabular}{@{}c@{}}%
+    \faPython\ I'm a \\ Python \\ user \faPython
+  \end{tabular}}%
+}
+
+\mylogo
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\tikzbrickfigurine[custom logo,logo=\mylogo]{4cm}%with 'global' scale
+\tikzbrickfigurine[display logo,logo=\mylogo]{4cm}%with 'cancel' scale
+\tikzbrickfigurine[adjusted logo=\mylogo]{4cm}%adjusted
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\tikzbrickfigurine[custom logo,logo=\mylogo,scale logo=1]{4cm}%with 'global' scale
+\tikzbrickfigurine[display logo,logo=\mylogo,scale logo=1]{4cm}%with 'cancel' scale
+\tikzbrickfigurine[adjusted logo=\mylogo,scale logo=1]{4cm}%adjusted
+\end{DemoCode}
+
 \pagebreak
 
 \section{Samples}
@@ -490,6 +539,8 @@
 \begin{DemoCode}{}
 \definecolor{brickskin}{HTML}{FFDFC4}
 
+\def\mylogo{\rotatebox{30}{\sffamily\begin{tabular}{@{}c@{}}\faFastForward\ I'm a\\\LaTeX\\user \faFastBackward\end{tabular}}}
+
 \tikzbrickfigurine%
   [%
     color lines=darkgray,
@@ -506,8 +557,8 @@
     color top pant=pink,
     color middle pant=pink!50!black,
     color foot=white,
-    display logo,scale logo=0.8,
-    logo={\openmoji{unicorn}},
+    adjusted logo=\mylogo,
+    scale logo=1, 
     hairstyle=6,%
     eyestyle=5,%
     eyebrowstyle=10,%

Modified: trunk/Master/texmf-dist/tex/latex/tikzbrickfigurines/tikzbrickfigurines.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tikzbrickfigurines/tikzbrickfigurines.sty	2025-08-18 19:02:24 UTC (rev 76087)
+++ trunk/Master/texmf-dist/tex/latex/tikzbrickfigurines/tikzbrickfigurines.sty	2025-08-18 19:02:37 UTC (rev 76088)
@@ -2,9 +2,10 @@
 % licence.........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tikzbrickfigurines}[2025/08/12 0.1.0 Small brickfigurines, made with tikz]
+\ProvidesPackage{tikzbrickfigurines}[2025/08/18 0.1.1 Small brickfigurines, made with tikz]
 
 %====HISTORY
+% v 0.1.1  Enhancements for adjusted logo
 % v 0.1.0  Initial version
 
 %====PACKAGES
@@ -11,6 +12,7 @@
 \RequirePackage{simplekv}
 \RequirePackage{xstring}
 \RequirePackage{ifthen}
+\RequirePackage{etoolbox}
 \RequirePackage{listofitems}
 \RequirePackage{graphicx}
 \RequirePackage{calc}
@@ -50,6 +52,7 @@
   color middle pant=\tikzset{brickfig shape middle pant/.style={fill=#1}},
   color foot=\tikzset{brickfig shape foot/.style={fill=#1}},%
   logo=\def\tkzshapebrickfiglogo{#1},%
+  adjusted logo=\def\tkzshapebrickadjustlogo{#1},%
   scale logo=\def\tkzshapebrickfigscalelogo{#1},%
   figure name=\def\tkzshapebrickfigname{#1}
 }
@@ -73,7 +76,7 @@
   color foot=darkgray!50!black,%
   display logo=false,%
   custom logo=false,%
-  logo={ },%
+  logo={},%
   scale logo=0.667,
   man=false,%
   woman=false,%
@@ -89,7 +92,8 @@
   bbox=false,%
   head=false,%
   vcenter=false,%
-  figure name=MYBRICKFIG
+  figure name=MYBRICKFIG,%
+  adjusted logo={}
 }
 
 %----init styles
@@ -589,9 +593,26 @@
   \coordinate (\tkzshapebrickfigname-BELT) at (0,-0.4) ;
   \coordinate (\tkzshapebrickfigname-RIGHTSHOULDER) at (-2.75,4.5) ;
   \coordinate (\tkzshapebrickfigname-LEFTSHOULDER) at (2.75,4.5) ;
-	\coordinate (\tkzshapebrickfigname-NECK) at (0,5.225) ;
+  \coordinate (\tkzshapebrickfigname-NECK) at (0,5.225) ;
 }
+%----internal macro adjustedlogo
+\newsavebox\tmpboxlogotofith
+\newsavebox\tmpboxlogotofitv
+\newlength\tmpwidthlogotofitv
 
+\newcommand\adjustlogotosweat[1]{%
+  \savebox{\tmpboxlogotofitv}{\resizebox*{!}{\fpeval{1/\tkzbrickfigscale}\tkzbrickfigheightlogo}{#1}}%v-stretch
+  \savebox{\tmpboxlogotofith}{\resizebox*{\fpeval{1/\tkzbrickfigscale}\tkzbrickfigwidthlogo}{!}{#1}}%h-stretch
+  \settowidth\tmpwidthlogotofitv{\usebox{\tmpboxlogotofitv}}%
+  \ifthenelse{\tmpwidthlogotofitv < \tkzbrickfigwidthlogo}%
+    {%width ok
+      {\usebox{\tmpboxlogotofitv}}%
+    }%
+    {%width ko => h-stretch
+      {\usebox{\tmpboxlogotofith}}%
+    }%
+}
+
 %----main macro
 \NewDocumentCommand\tikzbrickfigurine{O{}D<>{}m}{%
   \restoreKV[tkzshapebrickfig]%
@@ -641,6 +662,10 @@
       \tikzset{brickfig shape foot/.style={}}%
     }%
     {}%
+  %----adjusted logo
+  \ifdefempty{\tkzshapebrickadjustlogo}%
+    {}%
+    {\setKV[tkzshapebrickfig]{display logo=false,custom logo=false}}%
   %----prefefined styles (??)
   \ifboolKV[tkzshapebrickfig]{man}%
     {%
@@ -661,8 +686,8 @@
   %----lengths
   \setlength\tkzbrickfigheight{#3}%
   \xdef\tkzbrickfigscale{\fpeval{\tkzbrickfigheight/16cm}}%
-  \setlength\tkzbrickfigheightlogo{\fpeval{\tkzshapebrickfigscalelogo*4/16}\tkzbrickfigheight}%
-  \setlength\tkzbrickfigwidthlogo{\fpeval{\tkzshapebrickfigscalelogo*4/16}\tkzbrickfigheight}%
+  \setlength\tkzbrickfigheightlogo{\fpeval{\tkzshapebrickfigscalelogo*5/16}\tkzbrickfigheight}%
+  \setlength\tkzbrickfigwidthlogo{\fpeval{\tkzshapebrickfigscalelogo*4.5/16}\tkzbrickfigheight}%
   %----picture
   \begin{tikzpicture}[\tkzshapebrickfiglinescolor,scale=\tkzbrickfigscale,line width=\fpeval{\tkzbrickfigscale*0.8}mm,line join=round,line cap=round,#2,brickfig shape bbox,brickfig shape vcenter,transform shape]
     %----body / neck / head / legs / arms
@@ -685,13 +710,16 @@
     %logo (auto or custom)
     \begin{scope}
       \clip (-2.25,0) rectangle (2.25,5) ;
-      \ifboolKV[tkzshapebrickfig]{display logo}%
+      \ifboolKV[tkzshapebrickfig]{display logo}%with cancel scale
         {\node[inner sep=0pt,scale=\fpeval{1/(\tkzbrickfigscale)}] at (\tkzshapebrickfigname-LOGO) {\resizebox{!}{\tkzbrickfigheightlogo}{\tkzshapebrickfiglogo}};}%
         {}%
-      \ifboolKV[tkzshapebrickfig]{custom logo}%
-        {\node[inner sep=0pt] at (\tkzshapebrickfigname-LOGO) {\tkzshapebrickfiglogo} ;}%
+      \ifboolKV[tkzshapebrickfig]{custom logo}%with scale propagated
+        {\node[inner sep=0pt] at (\tkzshapebrickfigname-LOGO) {\tkzshapebrickfiglogo} ;}%play with \tkzbrickfigscale...
         %{\node[inner sep=0pt,scale=\fpeval{1/(\tkzbrickfigscale)}] at (\tkzshapebrickfigname-LOGO) {\tkzshapebrickfiglogo} ;}%
         {}%
+      \ifdefempty{\tkzshapebrickadjustlogo}%with adjusted logo (test...)
+        {}%
+        {\node[inner sep=0pt] at (\tkzshapebrickfigname-LOGO) {\adjustlogotosweat{\tkzshapebrickadjustlogo}} ;}%
     \end{scope}
   \end{tikzpicture}%
 }
@@ -708,16 +736,12 @@
       \setsepchar[.]{/}%
       \readlist*\tmpNUMlist{#4}%
       \itemtomacro\tmpNUMlist[1]\tmpNUMmouth%
-      %\StrChar{#3}{1}[\tmpNUMmouth]%
       \IfStrEq{\tmpNUMmouth}{*}{\xdef\tmpNUMmouth{\fpeval{randint(1,10)}}}{}%
       \itemtomacro\tmpNUMlist[2]\tmpNUMeye%
-      %\StrChar{#3}{2}[\tmpNUMeye]%
       \IfStrEq{\tmpNUMeye}{*}{\xdef\tmpNUMeye{\fpeval{randint(1,10)}}}{}%
       \itemtomacro\tmpNUMlist[3]\tmpNUMeyebrow%
-      %\StrChar{#3}{3}[\tmpNUMeyebrow]%
       \IfStrEq{\tmpNUMeyebrow}{*}{\xdef\tmpNUMeyebrow{\fpeval{randint(1,10)}}}{}%
       \itemtomacro\tmpNUMlist[4]\tmpNUMhair%
-      %\StrChar{#3}{4}[\tmpNUMhair]%
       \IfStrEq{\tmpNUMhair}{*}{\xdef\tmpNUMhair{\fpeval{randint(0,10)}}}{}%
     }%
   \tikzbrickfigurine[#1,mouthstyle=\tmpNUMmouth,hairstyle=\tmpNUMhair,eyestyle=\tmpNUMeye,eyebrowstyle=\tmpNUMeyebrow]<#2>{#3}%



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