texlive[76104] Master/texmf-dist: tikz-decofonts (20aug25)

commits+karl at tug.org commits+karl at tug.org
Wed Aug 20 22:02:00 CEST 2025


Revision: 76104
          https://tug.org/svn/texlive?view=revision&revision=76104
Author:   karl
Date:     2025-08-20 22:02:00 +0200 (Wed, 20 Aug 2025)
Log Message:
-----------
tikz-decofonts (20aug25)

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

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

Modified: trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tikz-decofonts-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tikz-decofonts-doc.tex	2025-08-20 20:01:51 UTC (rev 76103)
+++ trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tikz-decofonts-doc.tex	2025-08-20 20:02:00 UTC (rev 76104)
@@ -12,6 +12,7 @@
 \usepackage[nott]{kpfonts}
 \usepackage{inconsolata}
 \usepackage{tikz-decofonts}
+\usepackage{enumitem}
 \usepackage{fancyvrb}
 \usepackage{setspace}
 \usepackage{fancyhdr}
@@ -32,8 +33,8 @@
 \hypersetup{pdfborder=0 0 0}
 \usepackage[margin=2cm]{geometry}
 \setlength{\parindent}{0pt}
-\def\TPversion{0.1.4}
-\def\TPdate{17/07/2025}
+\def\TPversion{0.1.5}
+\def\TPdate{20/08/2025}
 \usepackage{tcolorbox}
 \tcbuselibrary{breakable,skins,hooks,listingsutf8}
 
@@ -51,7 +52,7 @@
 	keywordstyle={\color{violet}},%
 	classoffset=2,%
 	alsoletter={-},%
-	morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote,\tkzcomicbubble,\tkzunderline,\tkzsurround,\tkzfittextinarrow},%
+	morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote,\tkzcomicbubble,\tkzunderline,\tkzsurround,\tkzfittextinarrow,\tkzcircledtxt},%
 	keywordstyle={\color{green!50!black}},%
 	classoffset=3,%
 	morekeywords={},%
@@ -81,7 +82,7 @@
 		keywordstyle={\color{violet}},%
 		classoffset=2,%
 		alsoletter={-},%
-		morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote,\tkzbicolor,\tkzcomicbubble,\tkzunderline,\tkzsurround,\tkzfittextinarrow},%
+		morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote,\tkzbicolor,\tkzcomicbubble,\tkzunderline,\tkzsurround,\tkzfittextinarrow,\tkzcircledtxt},%
 		keywordstyle={\color{green!50!black}},%
 		classoffset=3,%
 		morekeywords={color,lines,scale,height,offseth,offsetv,thick,gridcolor,gridafter,nospaceafter,border,colors,style,intdelta,paralcolors,width,node,txtcolor,width,bheight,sheight,hoffset,shadow,shownodes,expand,globalwidth},%
@@ -574,8 +575,86 @@
 
 \pagebreak
 
+\subsection{Freehand circled text}
+
+\begin{DemoCode}{listing only}
+\tkzcircledtxt[<keys>]<tikzpicture options>{text}
+
+%height       = height for manual insertion (2em)
+%width        = width for manual insertion (2.3em)
+%thickness    = thickness, percentage of height (0.05)
+%fill color   = bg color (lightgray!30)
+%rule color   = boxrule color (black)
+%rotate       = optional rotation (0)
+%auto         = auto width/height/raise relative to len of inside text (0)
+%fill         = boolean for filling (true)
+%font         = optional font
+%vstretch     = coefficient for vertical stretch, with auto usage (1.5)
+%hoffset      = coefficient for horizontal offset with auto usage (0.8)
+%random       = boolean for random effect (false)
+%arabic       = boolean for arabic version of counter (false)
+%alph         = boolean for alph version of counter (false)
+%Alph         = boolean for Alpha version of counter (false)
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%manual insertion (height + width + font)
+{q\LARGE\sffamily\bfseries\tkzcircledtxt{99}H}\\
+{q\LARGE\sffamily\bfseries\tkzcircledtxt[random]{99}H}\\
+{q\LARGE\sffamily\bfseries\tkzcircledtxt[random]{text}H}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%automatic insertion relative to len of small text
+{\Huge q\tkzcircledtxt[auto=1]{7}H or q\tkzcircledtxt[auto=2]{7}H}\\
+{\Huge q\tkzcircledtxt[auto=2]{99}H or q\tkzcircledtxt[auto=3]{99}H}\\
+{\Huge q\tkzcircledtxt[auto=2]{154}H or q\tkzcircledtxt[auto=3]{154}H }
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%with custom font
+{\Huge\sffamily q\tkzcircledtxt[font=\small\ttfamily,auto=3]{105}H}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\tkzcircledtxt[auto=1]{7} Let $f$ defined by $f(x)=x^{2}+5x-3$.
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%with enumitem package
+\begin{enumerate}[label={%
+    \color{darkgray}%
+    \tkzcircledtxt[thickness=0.075,fill=false,arabic,font=\large\bfseries,auto=1,%
+    fill color=teal!25,rule color=orange]{\arabic*}%
+    }%
+  ]
+  \item AAF
+  \item AAF
+  \begin{enumerate}[label={%
+      \color{red}%
+      \tkzcircledtxt[thickness=0.0375,fill=false,hoffset=0.25,alph,%
+      font=\bfseries,auto=1,rule color=teal]{\alph*}%
+      }%
+    ]
+    \item AA
+    \item BGHMG
+  \end{enumerate}
+  \item AAF
+  \item AAF
+  \item AAF
+  \item AAF
+  \item AAF
+  \item AAF
+  \item AAF
+\end{enumerate}
+\end{DemoCode}
+
+\pagebreak
+
 \section{History}
 
+\texttt{0.1.5: Small 'freehand' circled text}
+
 \texttt{0.1.4: Arrow with fitted text}
 
 \texttt{0.1.3: Underline or surround effect}

Modified: trunk/Master/texmf-dist/tex/latex/tikz-decofonts/tikz-decofonts.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tikz-decofonts/tikz-decofonts.sty	2025-08-20 20:01:51 UTC (rev 76103)
+++ trunk/Master/texmf-dist/tex/latex/tikz-decofonts/tikz-decofonts.sty	2025-08-20 20:02:00 UTC (rev 76104)
@@ -4,9 +4,10 @@
 %                 :              (https://tex.stackexchange.com/questions/460836/custom-line-cap-to-simulate-inked-line-in-tikz/460842#460842 from user121799)
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tikz-decofonts}[2025/07/17 0.1.4 Custom fonts, made with TikZ, with effects]
+\ProvidesPackage{tikz-decofonts}[2025/08/20 0.1.5 Custom fonts, made with TikZ, with effects]
 
 %------History
+% 0.1.5	Small 'freehand' circled text
 % 0.1.4	Arrow (fixed size) with text
 % 0.1.3	Underline/surround small texts
 % 0.1.2	Bd fonts (with callout.shapes)
@@ -1214,4 +1215,122 @@
 	\end{tikzpicture}%
 }
 
+%----freehand simple circled text
+\newlength\mytmpwidthfreehandnode
+\newlength\mytmpheightfreehandnode
+
+\ExplSyntaxOn
+\tl_new:N \c_tikzdecocct_alphabet_tl
+\box_new:N \l__tikzdecocct_widest_box
+\dim_new:N \l__tikzdecocct_widest_dim
+\tl_new:N \l__tikzdecocct_widest_tl
+\dim_new:N \mytmpmaxdimfreehandnode
+
+\NewDocumentCommand{\tikzdecocctcomputewidest}{O{}m}
+{
+	\group_begin:
+	\tl_set:Nn \c_tikzdecocct_alphabet_tl { #2 } %samples characters
+	#1 % optionally select a font
+	\dim_zero:N \l__tikzdecocct_widest_dim
+	\tl_clear:N \l__tikzdecocct_widest_tl
+	\tl_map_inline:Nn \c_tikzdecocct_alphabet_tl
+	{
+		\hbox_set:Nn \l__tikzdecocct_widest_box { ##1 }
+		\dim_compare:nT { \box_wd:N \l__tikzdecocct_widest_box > \l__tikzdecocct_widest_dim }
+		{
+			\dim_set:Nn \l__tikzdecocct_widest_dim { \box_wd:N \l__tikzdecocct_widest_box }
+			\tl_set:Nn \l__tikzdecocct_widest_tl { ##1 }
+		}
+	}
+	\dim_gset_eq:NN \mytmpmaxdimfreehandnode \l__tikzdecocct_widest_dim
+	\group_end:
+}
+\ExplSyntaxOff
+
+\defKV[customcircletxt]{%
+	height=\setlength\mytmpheightfreehandnode{#1},%
+	width=\setlength\mytmpwidthfreehandnode{#1},%
+	fill color=\colorlet{fillcolorcustomcircletxt}{#1},%
+	rule color=\colorlet{rulecolorcustomcircletxt}{#1},%
+	thickness=\def\mytmpthicknessfreehandnode{#1}
+}
+
+\setKVdefault[customcircletxt]{%
+	height=2em,
+	width=2.3em,
+	thickness=0.05,
+	fill color=lightgray!30,%
+	rule color=black,%
+	rotate=0,
+	auto=0,
+	fill=true,%
+	font={},
+	vstretch=1.5,%
+	hoffset=0.8,%
+	random=false,%
+	arabic=false,%
+	alph=false,%
+	Alph=false
+}
+
+\NewDocumentCommand\tkzcircledtxt{O{}D<>{}m}{%
+	\restoreKV[customcircletxt]%
+	\setKV[customcircletxt]{#1}%
+	\ifboolKV[customcircletxt]{random}%
+		{%
+			\xdef\mytmprandfreehandnode{\fpeval{randint(5,15)}}%
+		}%
+		{%
+			\def\mytmprandfreehandnode{7}%
+		}%
+	%
+	\begingroup\useKV[customcircletxt]{font}%
+	\ifnum\useKV[customcircletxt]{auto}=0\relax%
+		\begin{tikzpicture}[rotate={\useKV[customcircletxt]{rotate}},line width=\mytmpthicknessfreehandnode\mytmpheightfreehandnode,line cap=round,#2]
+	\else%
+		\settototalheight\mytmpheightfreehandnode{\hbox{0123456789}}%
+		\tikzdecocctcomputewidest{0123456789}%
+		\ifboolKV[customcircletxt]{arabic}%samples with 0123456789
+			{%
+				\settototalheight\mytmpheightfreehandnode{\hbox{0123456789}}%
+				\tikzdecocctcomputewidest{0123456789}%
+			}%
+			{}%
+		\ifboolKV[customcircletxt]{alph}%
+			{%
+				\settototalheight\mytmpheightfreehandnode{\hbox{abcdefghijklmnopqrstuvwxyz}}%
+				\tikzdecocctcomputewidest{abcdefghijklmnopqrstuvwxyz}%
+			}%
+			{}%
+		\ifboolKV[customcircletxt]{Alph}%
+			{%
+				\settototalheight\mytmpheightfreehandnode{\hbox{ABCDEFGHIJKLMNOPQRSTUVWXYZ}}%
+				\tikzdecocctcomputewidest{ABCDEFGHIJKLMNOPQRSTUVWXYZ}%
+			}%
+			{}%
+		\setlength\mytmpheightfreehandnode{\useKV[customcircletxt]{vstretch}\mytmpheightfreehandnode}%
+		\setlength\mytmpwidthfreehandnode{\fpeval{\useKV[customcircletxt]{auto}+\useKV[customcircletxt]{hoffset}}\mytmpmaxdimfreehandnode}%
+		\begin{tikzpicture}[rotate={\useKV[customcircletxt]{rotate}},line width=\mytmpthicknessfreehandnode\mytmpheightfreehandnode,line cap=round,baseline=(ZZZ-TXT.base),#2]
+	\fi%
+		\ifboolKV[customcircletxt]{fill}%
+			{%
+				%fill bg
+				\begin{scope}
+					\fill[fillcolorcustomcircletxt] (0,0.5\mytmpheightfreehandnode) to[out=\fpeval{180-\mytmprandfreehandnode},in=\fpeval{90+\mytmprandfreehandnode}] ++ ({-0.5\mytmpwidthfreehandnode},{-0.5\mytmpheightfreehandnode}) to[out=\fpeval{-90+\mytmprandfreehandnode},in=\fpeval{180+\mytmprandfreehandnode}] ++  ({0.5\mytmpwidthfreehandnode},{-0.5\mytmpheightfreehandnode}) to[out=\mytmprandfreehandnode,in=\fpeval{-90-\mytmprandfreehandnode}] ++ (0.5\mytmpwidthfreehandnode,0.5\mytmpheightfreehandnode) to[out=\fpeval{90-\mytmprandfreehandnode},in=1.5\mytmprandfreehandnode] cycle ;
+				\end{scope}
+			}%
+			{}%
+		%border
+		\begin{scope}
+			\draw[rulecolorcustomcircletxt] ([xshift=0.0275\mytmpmaxdimfreehandnode,yshift=\fpeval{-0.75*\mytmpthicknessfreehandnode}\mytmpheightfreehandnode]0,0.5\mytmpheightfreehandnode) to[out=\fpeval{180-\mytmprandfreehandnode},in=\fpeval{90+\mytmprandfreehandnode}] ++ ({-0.5\mytmpwidthfreehandnode},{-0.5\mytmpheightfreehandnode}) to[out=\fpeval{-90+\mytmprandfreehandnode},in=\fpeval{180+\mytmprandfreehandnode}] ++  ({0.5\mytmpwidthfreehandnode},{-0.5\mytmpheightfreehandnode}) to[out=\mytmprandfreehandnode,in=\fpeval{-90-\mytmprandfreehandnode}] ++ (0.5\mytmpwidthfreehandnode,0.5\mytmpheightfreehandnode) to[out=\fpeval{90-\mytmprandfreehandnode},in=\fpeval{1.5*\mytmprandfreehandnode}] ++ ([xshift=-0.155\mytmpwidthfreehandnode,yshift=\fpeval{2*\mytmpthicknessfreehandnode}\mytmpheightfreehandnode]{-0.5\mytmpwidthfreehandnode},{0.5\mytmpheightfreehandnode}) ;
+		\end{scope}
+		%node
+		\begin{scope}
+			\clip (0,0.5\mytmpheightfreehandnode) to[out=\fpeval{180-\mytmprandfreehandnode},in=\fpeval{90+\mytmprandfreehandnode}] ++ ({-0.5\mytmpwidthfreehandnode},{-0.5\mytmpheightfreehandnode}) to[out=\fpeval{-90+\mytmprandfreehandnode},in=\fpeval{180+\mytmprandfreehandnode}] ++  ({0.5\mytmpwidthfreehandnode},{-0.5\mytmpheightfreehandnode}) to[out=\mytmprandfreehandnode,in=\fpeval{-90-\mytmprandfreehandnode}] ++ (0.5\mytmpwidthfreehandnode,0.5\mytmpheightfreehandnode) to[out=\fpeval{90-\mytmprandfreehandnode},in=-\mytmprandfreehandnode] cycle ;
+			\node[inner sep=0pt] (ZZZ-TXT) at (0,0) {#3} ;
+		\end{scope}
+	\end{tikzpicture}%
+	\endgroup%
+}
+
 \endinput
\ No newline at end of file



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