summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pxpic
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-01-12 21:24:12 +0000
committerKarl Berry <karl@freefriends.org>2021-01-12 21:24:12 +0000
commit27346c71d2523f5f9c84602f857d59ce21f05b4f (patch)
treedfe90fef2e8f392006beaafff2839524261a113b /Master/texmf-dist/tex/latex/pxpic
parentf457b191c09c01b2daa0aa5662cdce782b0fde96 (diff)
pxpic (12jan21)
git-svn-id: svn://tug.org/texlive/trunk@57400 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pxpic')
-rw-r--r--Master/texmf-dist/tex/latex/pxpic/pxpic.sty177
1 files changed, 177 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/pxpic/pxpic.sty b/Master/texmf-dist/tex/latex/pxpic/pxpic.sty
new file mode 100644
index 00000000000..3a8c73ff023
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pxpic/pxpic.sty
@@ -0,0 +1,177 @@
+%%
+%% This is file `pxpic.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pxpic.dtx (with options: `pkg')
+%%
+%% --------------------------------------------------------------
+%% pxpic -- draw pixel pictures
+%% E-mail: jspratte@yahoo.de
+%% Released under the LaTeX Project Public License v1.3c or later
+%% See http://www.latex-project.org/lppl.txt
+%% --------------------------------------------------------------
+%%
+%% Copyright (C) 2021 Jonathan P. Spratte
+%%
+%% This work may be distributed and/or modified under the conditions of the
+%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
+%% (at your option) any later version. The latest version of this license is in
+%% the file:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% This work is "maintained" (as per LPPL maintenance status) by
+%% Jonathan P. Spratte.
+%%
+%% This work consists of the file pxpic.dtx
+%% and the derived files pxpic.pdf
+%% pxpic.sty
+%%
+\ProvidesPackage{pxpic}[2021-01-10 v1.0 draw pixel pictures]
+\RequirePackage{xcolor}
+\RequirePackage{expkv}
+\@ifdefinable\pxpicHT{\newdimen\pxpicHT}
+\@ifdefinable\pxpicWD{\newdimen\pxpicWD}
+\pxpicHT=1pt
+\pxpicWD=\pxpicHT
+\protected\ekvdef{pxpic}{size}
+ {\pxpicHT=\dimexpr#1\relax\pxpicWD=\dimexpr#1\relax}
+\protected\ekvdef{pxpic}{ht}{\pxpicHT=\dimexpr#1\relax}
+\protected\ekvdef{pxpic}{wd}{\pxpicWD=\dimexpr#1\relax}
+\protected\ekvdef{pxpic}{skip}{\ekvdefNoVal{pxpic@px}{#1}{\pxskip}}
+\protected\ekvdef{pxpic}{colors}{\ekvparse\pxpic@noval\pxpic@setcolor{#1}}
+\ekvletkv{pxpic}{colours}{pxpic}{colors}
+\protected\ekvdef{pxpic}{mode}
+ {%
+ \@ifundefined{pxpic@parse@px@#1}%
+ {\pxpic@unknown@mode{#1}}%
+ {%
+ \expandafter\let\expandafter\pxpic@parse@px
+ \csname pxpic@parse@px@#1\endcsname
+ }%
+ }
+\newcommand*\pxpic{\hbox\bgroup\pxpic@}
+\newcommand\pxpic@[2][]
+ {%
+ \vbox
+ {%
+ \pxpicsetup{#1}%
+ \let\px\pxpic@px
+ \let\pxskip\pxpic@skip
+ \baselineskip\pxpicHT
+ \pxpic@parse#2\pxpic@end
+ }%
+ \egroup
+ }
+\ekvsetdef\pxpicsetup{pxpic}
+\newcommand*\pxpiclogo[1][.13ex]
+ {%
+ \begingroup
+ \pxpicHT\dimexpr#1\relax
+ \pxpicWD\pxpicHT
+ \leavevmode
+ \lower3.2\pxpicHT\pxpic
+ [mode=px,colours={o=[HTML]{9F393D},g=black!75},skip=.]
+ {
+ {............................................g}
+ {...........................................gggg}
+ {.oooo.......................gggg...........ggg}
+ {.ooooo...oo......oo...oo....ggggg...gg......g..........g}
+ {.ooooooooooo...ooooo..oooo..ggggggggggg...ggggg...ggggggg}
+ {..ooooo..oooo.ooooooooooo....ggggg..gggg.ggggggg.ggggggggg}
+ {...oooo..oooo....ooooo........gggg..gggg...gggg..gggg.ggg}
+ {...oooo..oooo.....oooo........gggg..gggg...gggg..gggg}
+ {.oooooo..oooo.....ooooo.....gggggg..gggg...gggg..gggg}
+ {oooooooooooo...ooooooooo...gggggggggggg....gggg..ggggggggg}
+ {o.oooooooo....ooooo.oooooo.g.gggggggg......ggggg..ggggggg}
+ {...ooo.o......o.oo...oo.......ggg.g.........gg......ggg}
+ {...ooo........................ggg}
+ {...ooo........................ggg}
+ {....o..........................g}
+ }%
+ \endgroup
+ }
+\newcommand\pxpicforget[1]
+ {\expandafter\let\csname\ekv@name{pxpic@px}{#1}N\endcsname\pxpic@undef}
+\protected\def\pxpicnewmode#1#2%
+ {\expandafter\newcommand\csname pxpic@parse@px@#1\endcsname[1]{#2}}
+\protected\def\pxpicsetmode#1#2%
+ {\long\expandafter\def\csname pxpic@parse@px@#1\endcsname##1{#2}}
+\long\def\pxpic@ifend#1\pxpic@end{}
+\let\pxpic@ifempty\ekv@ifempty
+\long\def\pxpic@ifbracket#1\pxpic@end[#2]\pxpic@end{\pxpic@ifempty{#2}}
+\newcommand\pxpic@parse[1]
+ {%
+ \pxpic@ifend#1\pxpic@done\pxpic@end
+ \hbox{\pxpic@parseline#1\pxpic@end}%
+ \pxpic@parse
+ }
+\long\def\pxpic@done\pxpic@end\hbox#1\pxpic@parse{}
+\newcommand\pxpic@parseline[1]
+ {%
+ \pxpic@ifend#1\pxpic@linedone\pxpic@end
+ \pxpic@parse@px{#1}%
+ \pxpic@parseline
+ }
+\long\def\pxpic@linedone\pxpic@end\pxpic@parse@px#1\pxpic@parseline{}
+\newcommand\pxpic@parse@px@px[1]
+ {%
+ \ekvifdefinedNoVal{pxpic@px}{#1}
+ {\csname\ekv@name{pxpic@px}{#1}N\endcsname}%
+ {%
+ \pxpic@unknown@px{#1}%
+ \pxskip
+ }%
+ }
+\let\pxpic@parse@px\pxpic@parse@px@px
+\newcommand\pxpic@parse@px@named[1]
+ {%
+ \pxpic@ifempty{#1}
+ {\pxskip}
+ {{\color{#1}\px}}%
+ }
+\def\pxpic@tmp#1%
+ {%
+ \pxpicnewmode{#1}%
+ {%
+ \pxpic@ifempty{##1}
+ {\pxskip}
+ {{\color[#1]{##1}\px}}%
+ }%
+ }
+\pxpic@tmp{rgb}
+\pxpic@tmp{cmy}
+\pxpic@tmp{cmyk}
+\pxpic@tmp{hsb}
+\pxpic@tmp{Hsb}
+\pxpic@tmp{tHsb}
+\pxpic@tmp{gray}
+\pxpic@tmp{RGB}
+\pxpic@tmp{HTML}
+\pxpic@tmp{HSB}
+\pxpic@tmp{Gray}
+\pxpic@tmp{wave}
+\let\pxpic@tmp\pxpic@undef
+\newcommand\pxpic@px{\vrule\@height\pxpicHT\@width\pxpicWD\@depth\z@}
+\newcommand\pxpic@skip{\hskip\pxpicWD}
+\newcommand\pxpic@setcolor[2]
+ {%
+ \pxpic@ifbracket\pxpic@end#2.\pxpic@end[]\pxpic@end
+ \pxpic@setcolor@a\pxpic@setcolor@b
+ {#1}{#2}%
+ }
+\newcommand\pxpic@setcolor@a[2]
+ {\ekvdefNoVal{pxpic@px}{#1}{{\color{#2}\px}}}
+\newcommand\pxpic@setcolor@b[2]
+ {\ekvdefNoVal{pxpic@px}{#1}{{\color#2\px}}}
+\newcommand\pxpic@noval[1]
+ {\PackageError{pxpic}{Missing colour definition for name `\detokenize{#1}'}{}}
+\newcommand\pxpic@unknown@px[1]
+ {\PackageError{pxpic}{Unknown pixel `\detokenize{#1}'. Skipping}{}}
+\newcommand\pxpic@unknown@mode[1]
+ {\PackageError{pxpic}{Unknown mode `#1'}{}}
+%%
+%%
+%% End of file `pxpic.sty'.