texlive[74781] Master/texmf-dist: tikz-decofonts (28mar25)

commits+karl at tug.org commits+karl at tug.org
Fri Mar 28 22:33:42 CET 2025


Revision: 74781
          https://tug.org/svn/texlive?view=revision&revision=74781
Author:   karl
Date:     2025-03-28 22:33:42 +0100 (Fri, 28 Mar 2025)
Log Message:
-----------
tikz-decofonts (28mar25)

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-03-28 21:33:34 UTC (rev 74780)
+++ trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tikz-decofonts-doc.tex	2025-03-28 21:33:42 UTC (rev 74781)
@@ -29,8 +29,8 @@
 \hypersetup{pdfborder=0 0 0}
 \usepackage[margin=2cm]{geometry}
 \setlength{\parindent}{0pt}
-\def\TPversion{0.1.2}
-\def\TPdate{03/02/2025}
+\def\TPversion{0.1.3}
+\def\TPdate{28/03/2025}
 \usepackage{tcolorbox}
 \tcbuselibrary{breakable,skins,hooks,listingsutf8}
 
@@ -48,7 +48,7 @@
 	keywordstyle={\color{violet}},%
 	classoffset=2,%
 	alsoletter={-},%
-	morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote,\tkzcomicbubble},%
+	morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote,\tkzcomicbubble,\tkzunderline,\tkzsurround},%
 	keywordstyle={\color{green!50!black}},%
 	classoffset=3,%
 	morekeywords={},%
@@ -78,10 +78,10 @@
 		keywordstyle={\color{violet}},%
 		classoffset=2,%
 		alsoletter={-},%
-		morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote,\tkzbicolor,\tkzcomicbubble},%
+		morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote,\tkzbicolor,\tkzcomicbubble,\tkzunderline,\tkzsurround},%
 		keywordstyle={\color{green!50!black}},%
 		classoffset=3,%
-		morekeywords={color,lines,scale,height,offseth,offsetv,thick,gridcolor,gridafter,nospaceafter,border,colors,style,intdelta,paralcolors},%
+		morekeywords={color,lines,scale,height,offseth,offsetv,thick,gridcolor,gridafter,nospaceafter,border,colors,style,intdelta,paralcolors,width,node},%
 		keywordstyle={\color{orange}}
 	},%
 	#1
@@ -127,8 +127,8 @@
 				\begin{tabular}{c}
 					{\Huge \texttt{tikz-decofonts}}\\
 					\\
-					{\LARGE Simple "decoration" fonts, made} \\
-					{\LARGE with Ti\textit{k}Z, for small texts\ldots} \\
+					{\LARGE Simple "decoration" fonts or effects,} \\
+					{\LARGE made with Ti\textit{k}Z, for small texts\ldots} \\
 					\\
 					{\small \texttt{Version \TPversion{} -- \TPdate}}
 				\end{tabular}
@@ -159,6 +159,8 @@
 %bicolor effect
 \tkzbicolor[colors=blue/red,style=ndiag]{\Huge\sffamily DECORATION}
 \tkzbicolor[colors=teal/orange,style=ellips]{\Huge\sffamily DECORATION}
+%surround effect
+\tkzsurround[color=orange]{$I= \displaystyle\int_{a}^{b} f(x) \textrm{d}x = F(b)-F(a)$}
 \end{tcblisting}
 
 \begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
@@ -177,6 +179,10 @@
 \hfill\tkzbicolor[colors=blue/red,style=ndiag]{\Huge\sffamily DECORATION}~~\tkzbicolor[colors=teal/orange,style=ellips]{\Huge\sffamily DECORATION}\hfill~
 \end{tcolorbox}
 
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
+\hfill\tkzsurround[color=orange]{$I= \displaystyle\int_{a}^{b} f(x) \textrm{d}x = F(b)-F(a)$}\hfill~
+\end{tcolorbox}
+
 \vfill~
 
 \hrule
@@ -458,8 +464,49 @@
 
 \pagebreak
 
+\subsection{Surround effect}
+
+\begin{DemoCode}{listing only}
+\tkzsurround[width=...,node=...,color=...]{text}
+
+%width = width of line (1.25pt by default)
+%color = red by default
+%node  = name of node (AAAAZ by default)
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\tkzsurround[node=AAA]{This is a sample text} and we're trying to see what it does 
+by \tkzsurround[color=blue,width=1.5pt,node=BBB]{surrounding} certain portions of the text!
+
+{\tikz[remember picture,overlay] 
+    \draw[densely dashed,orange,<->,very thick,>=latex]
+    ([yshift=-1mm]AAA.south east) to[bend right] ([yshift=-1mm]BBB.south west) ;
+}
+\end{DemoCode}
+
+\subsection{Underline effect}
+
+\begin{DemoCode}{listing only}
+\tkzunderline[width=...,node=...,color=...,height=...]{text}
+
+%width  = width of line (1.25pt by default)
+%color  = red by default
+%height = global height of underlining (10mm by default)
+%node   = name of node (AAAAZ by default)
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\tkzunderline{This is a sample text} with
+\tkzunderline[color=blue,width=1.5pt,height=15mm]{underlining} certain
+\tkzunderline[color=yellow,width=1pt,height=15pt]{portions}!
+\end{DemoCode}
+
+\pagebreak
+
 \section{History}
 
+\texttt{0.1.3: Underline or surround effect}
+
 \texttt{0.1.2: Comic bubble}
 
 \texttt{0.1.1: Bicolor 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-03-28 21:33:34 UTC (rev 74780)
+++ trunk/Master/texmf-dist/tex/latex/tikz-decofonts/tikz-decofonts.sty	2025-03-28 21:33:42 UTC (rev 74781)
@@ -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/02/03 0.1.2 Custom fonts, made with TikZ, with effects]
+\ProvidesPackage{tikz-decofonts}[2025/03/28 0.1.3 Custom fonts, made with TikZ, with effects]
 
 %------History
+% 0.1.3	Underline/surround small texts
 % 0.1.2	Bd fonts (with callout.shapes)
 % 0.1.1	Bicolor txt
 % 0.1.0	Initial version
@@ -17,7 +18,7 @@
 \RequirePackage{xintexpr}
 \RequirePackage{listofitems}
 \RequirePackage{simplekv}
-\usetikzlibrary{decorations,decorations.pathreplacing,calc,positioning,bbox,arrows.meta,bending,shapes.callouts}
+\usetikzlibrary{decorations,decorations.pathreplacing,decorations.pathmorphing,calc,positioning,bbox,arrows.meta,bending,shapes.callouts}
 
 %------Paintbrush
 \pgfmathdeclarerandomlist{randcolor}{{black}{white}}
@@ -1005,4 +1006,89 @@
 		}%
 }
 
+%====UNDERLINE/SURROUND
+\newcommand\calcwidthnodetikz[2]{%
+	\pgfpointdiff{\pgfpointanchor{#1}{east}}{\pgfpointanchor{#1}{west}}%
+	\pgf at xa=\pgf at x
+	\pgf at ya=\pgf at y
+	% to convert from pt to cm   
+	\pgfmathparse{veclen(\pgf at xa,\pgf at ya)/28.45274}%
+	\global\let#2\pgfmathresult%
+}
+\newcommand\calcheightnodetikz[2]{%
+	\pgfpointdiff{\pgfpointanchor{#1}{south}}{\pgfpointanchor{#1}{north}}%
+	\pgf at xa=\pgf at x
+	\pgf at ya=\pgf at y
+	% to convert from pt to cm   
+	\pgfmathparse{veclen(\pgf at xa,\pgf at ya)/28.45274}%
+	\global\let#2\pgfmathresult%
+}
+
+\newlength\tkzheightunderline
+
+\defKV[tkzundersurr]{%
+	width=\def\tkzsurroundthick{#1},%
+	color=\def\tkzsurroundcolor{#1},%
+	node=\def\tkzsurroundnode{#1},%
+	height=\setlength\tkzheightunderline{#1}
+}
+\setKVdefault[tkzundersurr]{%
+	width=1.25pt,%
+	color=red,%
+	node=AAAAZ,%
+	height=10mm
+}
+
+\NewDocumentCommand\tkzsurround{ O{} m }{%
+	%#1=options
+	%#2=text
+	\restoreKV[tkzundersurr]%
+	\setKV[tkzundersurr]{#1}%
+	{\tikz[remember picture,baseline=(\tkzsurroundnode.base)]%
+		{\node[shape=rectangle,inner sep=0pt](\tkzsurroundnode){#2};}%
+	}%
+	\begin{tikzpicture}[remember picture,overlay]
+		\calcwidthnodetikz{\tkzsurroundnode}{\mytmpwidthnode}%
+		\xdef\offsettmpdecoh{\fpeval{-0.15*\mytmpwidthnode}}%
+		\xdef\offsettmpdecohb{\fpeval{0.25*\mytmpwidthnode}}%
+		\path[draw,line width=\tkzsurroundthick,\tkzsurroundcolor,{ink[bend]}-{ink[bend]}] plot[smooth] coordinates {%
+			([yshift=1.5mm]\tkzsurroundnode.north)
+			([xshift=-0.25mm,yshift=0.1mm]\tkzsurroundnode.north west)
+			([yshift=-0.2mm]\tkzsurroundnode.south west)
+			([xshift=-\offsettmpdecoh cm,yshift=-1mm]\tkzsurroundnode.south)
+			([yshift=-0.15mm]\tkzsurroundnode.south east)
+			([xshift=0.25mm,yshift=0.2mm]\tkzsurroundnode.north east)
+			([xshift=\offsettmpdecohb cm,yshift=1mm]\tkzsurroundnode.north)
+			([xshift=\offsettmpdecoh cm,yshift=-0.1mm]\tkzsurroundnode.north)
+		};%
+	\end{tikzpicture}%
+}
+
+
+\NewDocumentCommand\tkzunderline{ O{} m }{%
+	%#1=options
+	%#4=text
+	\restoreKV[tkzundersurr]%
+	\setKV[tkzundersurr]{#1}%
+	{\tikz[remember picture,baseline=(\tkzsurroundnode.base)]%
+		{\node[shape=rectangle,inner sep=0pt](\tkzsurroundnode){#2};}%
+	}%
+	\begin{tikzpicture}[remember picture,overlay]
+		\calcwidthnodetikz{\tkzsurroundnode}{\mytmpwidthnode}%
+		\xdef\offsettmpdecoha{\fpeval{0.25*\mytmpwidthnode}}%
+		\xdef\offsettmpdecohb{\fpeval{0.175*\mytmpwidthnode}}%
+		\xdef\offsettmpdecohc{\fpeval{0.1*\mytmpwidthnode}}%
+		\xdef\offsettmpdecohd{\fpeval{0.005*\mytmpwidthnode}}%
+		\path[draw,line width=\tkzsurroundthick,\tkzsurroundcolor,{ink[bend]}-{ink[bend]}] plot[smooth] 
+			coordinates {%
+				([yshift=-0.5*\tkzsurroundthick]\tkzsurroundnode.south west)
+				([yshift=-\tkzsurroundthick]\tkzsurroundnode.south east)
+				([xshift=-\offsettmpdecoha cm,yshift=-0.15\tkzheightunderline]\tkzsurroundnode.south)
+				([xshift=\offsettmpdecohb cm,yshift=-0.275\tkzheightunderline]\tkzsurroundnode.south)
+				([xshift=-\offsettmpdecohc cm,yshift=-0.4\tkzheightunderline]\tkzsurroundnode.south)
+				([yshift=-0.525\tkzheightunderline]\tkzsurroundnode.south)}
+			to ([xshift=\offsettmpdecohd cm,yshift=-\tkzheightunderline]\tkzsurroundnode.south) ;
+	\end{tikzpicture}%
+}
+
 \endinput
\ No newline at end of file



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