summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikzducks
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-11-21 22:14:30 +0000
committerKarl Berry <karl@freefriends.org>2017-11-21 22:14:30 +0000
commitea25281c5adfc7ae5a138c26ea181a72d6eb5301 (patch)
tree50728cc5b4d0d60d5bb2fcea9fc01d6f837735a5 /Master/texmf-dist/tex/latex/tikzducks
parent1c39bbfbefd2ecda16fcbfae312a67507fd9ccaf (diff)
tikzducks (21nov17)
git-svn-id: svn://tug.org/texlive/trunk@45874 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzducks')
-rw-r--r--Master/texmf-dist/tex/latex/tikzducks/tikzducks.sty379
1 files changed, 304 insertions, 75 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzducks/tikzducks.sty b/Master/texmf-dist/tex/latex/tikzducks/tikzducks.sty
index 55f51b7cef1..5877b3e2001 100644
--- a/Master/texmf-dist/tex/latex/tikzducks/tikzducks.sty
+++ b/Master/texmf-dist/tex/latex/tikzducks/tikzducks.sty
@@ -10,8 +10,8 @@
% Released under the LaTeX Project Public License v1.3c or later
% See http://www.latex-project.org/lppl.txt
%
-% Version 0.4
-% Sep 04, 2017
+% Version 0.5
+% Nov 21, 2017
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -20,13 +20,21 @@
\RequirePackage{xcolor}
\RequirePackage{tikz}
\usetikzlibrary{patterns} % for the wizard hat
-%\usetikzlibrary{intersections} % for named paths
\usetikzlibrary{calc} % for the sports jerseys
+%\pgfdeclarelayer{backgroundlayer}
+%\pgfdeclarelayer{bodylayer}
+%\pgfdeclarelayer{clothinglayer}
+%\pgfdeclarelayer{hairlayer}
+%\pgfdeclarelayer{hatlayer}
+%
+%\pgfsetlayers{backgroundlayer,bodylayer,clothinglayer,hairlayer,hatlayer,main}
+
\newcommand*{\duck}[1][]{\tikzset{%
/duck/.cd,#1}\duck@draw%
}
+\newif\ifduck@name
% Environment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newif\ifduck@water
% body parts %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -37,41 +45,55 @@
\newif\ifduck@crazyhair
\newif\ifduck@recedinghair
\newif\ifduck@eyebrow
+\newif\ifduck@beard
% clothing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newif\ifduck@tshirt
\newif\ifduck@jacket
\newif\ifduck@tie
\newif\ifduck@cape
\newif\ifduck@stripes
-% Accessories %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newif\ifduck@glasses
-\newif\ifduck@sunglasses
+% Headgear %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newif\ifduck@alien
\newif\ifduck@hat
\newif\ifduck@cap
\newif\ifduck@santa
\newif\ifduck@unicorn
+\newif\ifduck@magichat
+\newif\ifduck@chef
+\newif\ifduck@witch
+\newif\ifduck@graduate
+\newif\ifduck@beret
+\newif\ifduck@crown
+\newif\ifduck@peakedcap
+\newif\ifduck@bunny
+\newif\ifduck@tophat
+% Accessories %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newif\ifduck@glasses
+\newif\ifduck@sunglasses
\newif\ifduck@icecream
\newif\ifduck@book
-\newif\ifduck@magichat
\newif\ifduck@magicwand
\newif\ifduck@cricket
\newif\ifduck@rollingpin
-\newif\ifduck@chef
\newif\ifduck@signpost
-\newif\ifduck@witch
-\newif\ifduck@graduate
\newif\ifduck@lightsaber
\newif\ifduck@cake
\newif\ifduck@pizza
\newif\ifduck@hockey
-\newif\ifduck@beret
\newif\ifduck@baguette
-\newif\ifduck@crown
\newif\ifduck@football
+\newif\ifduck@mask
+\newif\ifduck@necklace
+\newif\ifduck@milkshake
+\newif\ifduck@wine
+\newif\ifduck@prison
+\newif\ifduck@speech
+\newif\ifduck@think
+\newif\ifduck@torch
\tikzset{
/duck/.cd,
+ name/.code = \duck@nametrue \def\duck@name{#1},
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Environment
@@ -122,19 +144,19 @@
crazyhair/.code = \duck@crazyhairtrue \def\duck@hair{#1},
recedinghair/.code = \duck@recedinghairtrue \def\duck@hair{#1},
eyebrow/.code = \duck@eyebrowtrue \def\duck@eyebrow{#1},
+ beard/.code = \duck@beardtrue \def\duck@beard{#1},
% setting defaults %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
shorthair/.default = brown,
longhair/.default = brown,
crazyhair/.default = brown,
recedinghair/.default = brown,
eyebrow/.default = brown,
+ beard/.default = brown,
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %
+ % Headgear
+ %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % Accessories
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- glasses/.code = \duck@glassestrue \def\duck@glasses{#1},
- sunglasses/.code = \duck@sunglassestrue \def\duck@sunglasses{#1},
alien/.code = \duck@alientrue \def\duck@alien{#1},
hat/.code = \duck@hattrue \def\duck@hat{#1},
cap/.code = \duck@captrue \def\duck@cap{#1},
@@ -144,6 +166,39 @@
tassel/.code = \def\duck@tassel{#1},
beret/.code = \duck@berettrue \def\duck@beret{#1},
unicorn/.code = \duck@unicorntrue \def\duck@unicorn{#1},
+ magichat/.code = \duck@magichattrue \def\duck@magichat{#1},
+ magicstars/.code = \def\duck@magicstars{#1},
+ witch/.code = \duck@witchtrue \def\duck@witch{#1},
+ crown/.code = \duck@crowntrue \def\duck@crown{#1},
+ bunny/.code = \duck@bunnytrue \def\duck@bunny{#1},
+ inear/.code = \def\duck@inear{#1},
+ peakedcap/.code = \duck@peakedcaptrue \def\duck@peakedcap{#1},
+ tophat/.code = \duck@tophattrue \def\duck@tophat{#1},
+ % setting defaults %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ alien/.default = green,
+ hat/.default = brown,
+ cap/.default = blue,
+ santa/.default = red!80!black,
+ chef/.default = gray!20!white,
+ graduate/.default = black,
+ tassel = red,
+ beret/.default = black,
+ unicorn/.default = pink,
+ magichat/.default = violet,
+ magicstars = yellow!80!brown,
+ witch/.default = black,
+ crown/.default = yellow,
+ bunny/.default = \duck@body,
+ inear = \duck@bunny!50!white,
+ peakedcap/.default= blue,
+ tophat/.default = black,
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %
+ % Accessories
+ %
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ glasses/.code = \duck@glassestrue \def\duck@glasses{#1},
+ sunglasses/.code = \duck@sunglassestrue \def\duck@sunglasses{#1},
icecream/.code = \duck@icecreamtrue \def\duck@cone{#1},
flavoura/.code = \def\duck@flavoura{#1},
flavourb/.code = \def\duck@flavourb{#1},
@@ -153,10 +208,7 @@
signpost/.code = \duck@signposttrue \def\duck@signpost{#1},
signcolour/.code = \def\duck@signcolour{#1},
signback/.code = \def\duck@signback{#1},
- magichat/.code = \duck@magichattrue \def\duck@magichat{#1},
- magicstars/.code = \def\duck@magicstars{#1},
magicwand/.code = \duck@magicwandtrue,
- witch/.code = \duck@witchtrue \def\duck@witch{#1},
cricket/.code = \duck@crickettrue \def\duck@cricket{#1},
rollingpin/.code = \duck@rollingpintrue \def\duck@rollingpin{#1},
lightsaber/.code = \duck@lightsabertrue \def\duck@lightsaber{#1},
@@ -164,20 +216,19 @@
pizza/.code = \duck@pizzatrue,
hockey/.code = \duck@hockeytrue \def\duck@hockey{#1},
baguette/.code = \duck@baguettetrue \def\duck@baguette{#1},
- crown/.code = \duck@crowntrue \def\duck@crown{#1},
football/.code = \duck@footballtrue \def\duck@football{#1},
+ mask/.code = \duck@masktrue \def\duck@mask{#1},
+ necklace/.code = \duck@necklacetrue \def\duck@necklace{#1},
+ milkshake/.code = \duck@milkshaketrue \def\duck@milkshake{#1},
+ wine/.code = \duck@winetrue \def\duck@wine{#1},
+ prison/.code = \duck@prisontrue \def\duck@prison{#1},
+ speech/.code = \duck@speechtrue \def\duck@speech{#1},
+ think/.code = \duck@thinktrue \def\duck@think{#1},
+ bubblecolour/.code = \def\duck@bubblecolour{#1},
+ torch/.code = \duck@torchtrue \def\duck@torch{#1},
% setting defaults %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
glasses/.default = black,
sunglasses/.default = black,
- alien/.default = green,
- hat/.default = brown,
- cap/.default = blue,
- santa/.default = red!80!black,
- chef/.default = gray!20!white,
- graduate/.default = black,
- tassel = red,
- beret/.default = black,
- unicorn/.default = pink,
icecream/.default = brown!60!gray,
flavoura = brown!50!black,
flavourb = white!70!brown,
@@ -185,17 +236,20 @@
bookcolour = brown,
signcolour = brown!50!black,
signback = green!40!black,
- magichat/.default = violet,
- magicstars = yellow!80!brown,
- witch/.default = black,
cricket/.default = brown,
rollingpin/.default = brown,
lightsaber/.default = green,
cake/.default = violet,
hockey/.default = brown,
baguette/.default = brown,
- crown/.default = yellow,
football/.default = white,
+ mask/.default = black,
+ necklace/.default = white!80!gray,
+ milkshake/.default = red!20!white,
+ wine/.default = red!70!black,
+ prison/.default = gray,
+ bubblecolour = gray!30!white,
+ torch/.default = gray,
}
\def\duck@draw{
@@ -211,6 +265,11 @@
% defining some coordinates
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@name
+ \coordinate (\duck@name-wing) at (0.8,0.7);
+ \coordinate (\duck@name-head) at (0.9,2);
+ \coordinate (\duck@name-bill) at (0.5,1.3);
+\fi
\coordinate (wing) at (0.8,0.7);
\coordinate (head) at (0.9,2);
\coordinate (bill) at (0.5,1.3);
@@ -220,6 +279,7 @@
% Environment
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\begin{pgfonlayer}{backgroundlayer}
%
% water %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifduck@water
@@ -229,11 +289,13 @@
\fill[\duck@water, even odd rule] (1.00,0.40) ellipse (1.42 and 0.77) (1.00,0.40) ellipse (1.38 and 0.73);
\fi
%
+%\end{pgfonlayer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% body parts
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\begin{pgfonlayer}{bodylayer}
%
% body %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{pgfinterruptboundingbox}
@@ -252,6 +314,15 @@
\fill[\duck@bill] \duckpathbill;
\fi
%
+% Superhero mask %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% has to be behind the eyes
+\ifduck@mask
+ \begin{scope}
+ \clip (0.90,1.50) ellipse (0.50 and 0.625);
+ \fill[\duck@mask,rotate=-15] (-0.1,1.59) rectangle (1.3,1.88);
+ \end{scope}
+\fi%
+%
% right eye %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\fill[\duck@eye, rotate=-20]
(0.23,1.7675) ellipse (0.0893 and 0.125);
@@ -264,11 +335,13 @@
\fill[\duck@pupil, rotate=-20]
(-0.03,1.73) ellipse (0.0286 and 0.0643);
%
+%\end{pgfonlayer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% clothing
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\begin{pgfonlayer}{clothinglayer}
%
% tshirt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifduck@tshirt
@@ -301,11 +374,18 @@
\end{pgfinterruptboundingbox}
\fi
%
+% necklace (not really clothing, but needs to be below the hair) %%%%%
+\ifduck@necklace
+ \fill[\duck@necklace] (0.5000,1.112) circle (0.032) (0.5100,1.050) circle (0.032) (0.5200,0.990) circle (0.032) (0.5400,0.931) circle (0.032) (0.5825,0.885) circle (0.032) (0.6450,0.885) circle (0.032) (0.7000,0.910) circle (0.032) (0.7500,0.945) circle (0.032) (0.8000,0.980) circle (0.032) (0.8500,1.020) circle (0.032) (0.9000,1.050) circle (0.032) (0.9500,1.080) circle (0.032) (1.0000,1.110) circle (0.032) (1.0550,1.130) circle (0.032) (1.1100,1.150) circle (0.032) (1.1650,1.165) circle (0.032) (1.2200,1.180) circle (0.032) (1.2750,1.195) circle (0.032) (1.3300,1.210) circle (0.032);
+\fi
+%
+%\end{pgfonlayer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% hair styles
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\begin{pgfonlayer}{hairlayer}
%
% short hair %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifduck@shorthair
@@ -349,28 +429,24 @@
\fill[\duck@eyebrow, rounded corners=1, rotate=100] (1.67,-0.77) rectangle (1.73,-0.95);
\fi
%
+% beard %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfkeys{/duck/beard/.@def/.get=\duck@test}
+\ifx\duck@beard\duck@test
+ \ifdefined\duck@hair\let\duck@beard=\duck@hair\fi
+\fi%
+\ifduck@beard
+ \fill[\duck@beard] (1.3,1.3) circle (0.12) (1.2,1.15) circle (0.12) (0.5,1.05) circle (0.1) (0.525,0.90) circle (0.12) (0.525,0.75) circle (0.12) (0.65,0.65) circle (0.14) (0.75,0.75) circle (0.12) (0.85,0.85) circle (0.12) (0.95,0.95) circle (0.12) (1.05,1.05) circle (0.12) (1.15,1.25) circle (0.12) (1,1.20) circle (0.12) (0.85,1.20) circle (0.12) (0.75,1.15) circle (0.12) (0.65,1.10) circle (0.12) (0.58,1.07) circle (0.12) (0.44,1.46) circle (0.06) (0.52,1.45) circle (0.06) (0.6, 1.41) circle (0.06) (0.68,1.36) circle (0.06) (0.76,1.34) circle (0.06) (0.86,1.26) circle (0.12) (0.38,1.44) circle (0.03) (1,1.28) circle (0.12);
+ \fill[\duck@beard] (1.3,1.3) -- (0.5,1.05) -- (0.65,0.65) -- cycle;
+\fi%
+%
+%\end{pgfonlayer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% Accessories
+% Headgear
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\begin{pgfonlayer}{hatlayer}
%
-% sunglasses %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ifduck@sunglasses
- \fill[\duck@sunglasses,rotate=-17] (0.42,1.8) rectangle (0.8,1.84);
- \fill[\duck@sunglasses,rotate=-17] (0.12,1.8) rectangle (0.22,1.84);
- \fill[\duck@sunglasses,rotate=-20] (0.23,1.7675) circle (0.14);
- \fill[\duck@sunglasses,rotate=-20] (-0.06,1.74) circle (0.13);
-\fi
-%
-% glasses %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ifduck@glasses
- \fill[\duck@glasses,rotate=-17] (0.42,1.8) rectangle (0.8,1.84);
- \fill[\duck@glasses,rotate=-17] (0.12,1.8) rectangle (0.22,1.84);
- \fill[\duck@glasses,rotate=-20,even odd rule] (0.23,1.7675) circle (0.14) (0.23,1.7675) circle (0.11);
- \fill[\duck@glasses,rotate=-20,even odd rule] (-0.06,1.74) circle (0.13) (-0.06,1.74) circle (0.095);
-\fi
-%
% alien %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifduck@alien
\fill[\duck@alien,rotate=-25] (0.09,2.1) rectangle (0.16,2.6);
@@ -440,6 +516,80 @@
\fill[\duck@body!100,rotate=25] (1.50,1.43)--(1.60,1.8375)--(1.70,1.43);
\fi
%
+% magic hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@magichat
+ \path[preaction={fill, \duck@magichat!100},rotate=-5,
+ pattern=fivepointed stars, pattern color=\duck@magicstars!100]
+ (0.36,1.95)--(0.86,2.95)--(1.20,1.85);
+\fi
+%
+% witch %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@witch
+ \fill[\duck@witch,rotate=-15] (0.44,2.13) ellipse (0.75 and 0.17);
+ \fill[\duck@witch,rotate=-15] (0.05,2.2)--(0.45,3.2)--(0.82,2.2);
+\fi
+%
+% crown %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@crown
+ \path (0.7,1.95) rectangle (1.4,2.45);
+ \begin{pgfinterruptboundingbox}
+ \fill[\duck@crown,rotate=-10,xshift=-10,yshift=3] \duckpathcrown;
+ \end{pgfinterruptboundingbox}
+\fi
+%
+% Bunny ears %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@bunny
+ \path (0.55,1.9) rectangle (1.2,2.55);
+ \begin{pgfinterruptboundingbox}
+ \begin{scope}
+ \clip[rotate=-5] (0.68,2.38) ellipse (0.3 and 0.4);
+ \fill[\duck@bunny,rotate=-5] (1.06,2.2) ellipse (0.3 and 0.4) (0.28,2.26) ellipse (0.3 and 0.4);
+ \end{scope}
+
+ \begin{scope}
+ \clip[rotate=-5] (0.68,2.38) ellipse (0.25 and 0.35);
+ \fill[\duck@inear,rotate=-5] (1.06,2.2) ellipse (0.25 and 0.35) (0.28,2.26) ellipse (0.25 and 0.35);
+ \end{scope}
+ \end{pgfinterruptboundingbox}
+\fi
+%
+% peaked cap %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@peakedcap
+ \fill[\duck@peakedcap,rotate=-15] (0.35,2.05) ellipse (0.5 and 0.15);
+ \fill[\duck@peakedcap,rotate=-25] (0.13,2.15) ellipse (0.5 and 0.17);
+ \fill[\duck@peakedcap,rotate=-35] (-0.25,2.2) ellipse (0.55 and 0.17);
+\fi
+%
+% tophat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@tophat
+ \fill[\duck@tophat,rotate=-15] (0.44,2.1) ellipse (0.48 and 0.1);
+ \fill[\duck@tophat,rotate=-15] (0.12,2.1) -- (0.75,2.1) -- (0.81,2.55) -- (0.07,2.55) -- cycle;
+ \fill[\duck@tophat,rotate=-15] (0.44,2.55) ellipse (0.37 and 0.08);
+\fi
+%
+%\end{pgfonlayer}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Accessories
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% sunglasses %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@sunglasses
+ \fill[\duck@sunglasses,rotate=-17] (0.42,1.8) rectangle (0.8,1.84);
+ \fill[\duck@sunglasses,rotate=-17] (0.12,1.8) rectangle (0.22,1.84);
+ \fill[\duck@sunglasses,rotate=-20] (0.23,1.7675) circle (0.14);
+ \fill[\duck@sunglasses,rotate=-20] (-0.06,1.74) circle (0.13);
+\fi
+%
+% glasses %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@glasses
+ \fill[\duck@glasses,rotate=-17] (0.42,1.8) rectangle (0.8,1.84);
+ \fill[\duck@glasses,rotate=-17] (0.12,1.8) rectangle (0.22,1.84);
+ \fill[\duck@glasses,rotate=-20,even odd rule] (0.23,1.7675) circle (0.14) (0.23,1.7675) circle (0.11);
+ \fill[\duck@glasses,rotate=-20,even odd rule] (-0.06,1.74) circle (0.13) (-0.06,1.74) circle (0.095);
+\fi
+%
% icecream %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifduck@icecream
\fill[\duck@cone,rotate=-20] (0.35,1.20)--(0.50,0.60)--(0.75,1.20);
@@ -455,7 +605,7 @@
\node[rotate=-20, color=white] at (0.88,0.70) {\duck@book};%
\fi
%
-% signpost %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% signpost %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifduck@signpost
\fill[\duck@signcolour, rounded corners=1, rotate=-20] (0.8,0.75) rectangle (0.9,1.75);
\fill[\duck@signcolour, rounded corners=1, rotate=-20] (0.4,1.7) rectangle (1.3,2.4);
@@ -463,11 +613,18 @@
\node[rotate=-20, color=white] at (1.5,1.65) {\duck@signpost};
\fi
%
-% magic hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ifduck@magichat
- \path[preaction={fill, \duck@magichat!100},rotate=-5,
- pattern=fivepointed stars, pattern color=\duck@magicstars!100]
- (0.36,1.95)--(0.86,2.95)--(1.20,1.85);
+% speech bubble %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@speech
+ \fill[\duck@bubblecolour] (-0.5,1.8) ellipse (0.7 and 0.3);
+ \fill[\duck@bubblecolour] (-0.2,1.54) -- (0.2,1.35) -- (0.0,1.6) -- cycle;
+ \node at (-0.5,1.8) {\duck@speech};
+\fi
+%
+% think bubble %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@think
+ \fill[\duck@bubblecolour] (2,2.4) ellipse (0.7 and 0.35);
+ \fill[\duck@bubblecolour] (1.55,2.35) circle (0.25) (2.0,2.15) circle (0.25) (2.4,2.25) circle (0.25) (1.6,2.55) circle (0.25) (2.0,2.6) circle (0.25) (2.35,2.5) circle (0.25) (1.65,1.95) circle (0.1) (1.55,1.80) circle (0.06) (1.47,1.70) circle (0.03);
+ \node at (2,2.4) {\duck@think};
\fi
%
% magic wand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -476,12 +633,6 @@
\fill[white,rotate=-30] (0.27,1.13) rectangle (0.37,1.03);
\fi
%
-% witch %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ifduck@witch
- \fill[\duck@witch,rotate=-15] (0.44,2.13) ellipse (0.75 and 0.17);
- \fill[\duck@witch,rotate=-15] (0.05,2.2)--(0.45,3.2)--(0.82,2.2);
-\fi
-%
% cricket bat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifduck@cricket
\fill[\duck@cricket, rounded corners=2, rotate=-30] (0.4,1.2) rectangle (0.7,2.2);
@@ -539,14 +690,6 @@
\fill[\duck@baguette!80!black, rotate=5] (1.44,1.1) ellipse (0.1 and 0.03) (1.30,0.9) ellipse (0.1 and 0.03) (1.16,0.7) ellipse (0.1 and 0.03) (1.02,0.5) ellipse (0.1 and 0.03);
\fi
%
-% crown %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ifduck@crown
- \path (0.7,1.95) rectangle (1.4,2.45);
- \begin{pgfinterruptboundingbox}
- \fill[\duck@crown,rotate=-10,xshift=-10,yshift=3] \duckpathcrown;
- \end{pgfinterruptboundingbox}
-\fi
-%
% football %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifduck@football
\fill[\duck@football] (1.2,0.33) circle (0.32);
@@ -556,12 +699,90 @@
\end{scope}
\fi
%
+% milkshake %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@milkshake
+ \fill[cyan!10!white, rotate=-10] (0.8,0.50) ellipse (0.17 and 0.05);
+ \fill[cyan!10!white, rotate=-10] (0.8,0.55) ellipse (0.12 and 0.03);
+ \begin{scope}
+ \clip[rotate=-10] (0.58,0.5) rectangle (1.02,1.03);
+ \fill[cyan!10!white, rotate=-10] (0.8,0.94) ellipse (0.18 and 0.4);
+ \fill[\duck@milkshake, rotate=-10] (0.8,0.94) ellipse (0.15 and 0.36);
+ \end{scope}
+ \fill[white!85!yellow] (0.83,0.92) circle (0.05) (0.88,0.9) circle (0.05) (0.93,0.92) circle (0.05) (0.99,0.91) circle (0.05) (1.06,0.86) circle (0.05) (1.13,0.87) circle (0.05) (0.85,0.99) circle (0.05) (0.9,0.98) circle (0.07) (1.0,0.98) circle (0.07) (1.1,0.95) circle (0.07);
+ \fill[red!90!black] (1.0,1.1) circle (0.05);
+ \fill[white!85!yellow] (0.94,1.05) circle (0.05) (1.03,1.03) circle (0.05);
+ \fill[cyan!10!white, rotate=-10] (0.8,0.50) ellipse (0.17 and 0.05);
+ \fill[red!90!black,rotate=20] (1.2,0.58) rectangle (1.22,0.85);
+\fi
+%
+% wine %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@wine
+ \fill[cyan!10!white, rotate=-10] (0.8,0.50) ellipse (0.17 and 0.05);
+ \fill[cyan!10!white, rotate=-10] (0.8,0.55) ellipse (0.12 and 0.03);
+ \fill[cyan!10!white, rotate=-10] (0.8,0.7) ellipse (0.03 and 0.2);
+ \begin{scope}
+ \clip[rotate=-10] (0.58,0.5) rectangle (1.02,1.03);
+ \fill[cyan!10!white, rotate=-10] (0.8,1.1) ellipse (0.18 and 0.4);
+ \end{scope}
+ \begin{scope}
+ \clip[rotate=-10] (0.58,0.5) rectangle (1.02,0.87);
+ \fill[\duck@wine, rotate=-10] (0.8,1.1) ellipse (0.15 and 0.36);
+ \end{scope}
+\fi
+%
+% prison duck %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@prison
+ \fill[\duck@prison] (1.5,0.25) circle (0.3);
+ \fill[\duck@prison, even odd rule] (1.2,0.1) ellipse (0.10 and 0.07) (1.2,0.1) ellipse (0.06 and 0.04) (1.05,-0.05) ellipse (0.10 and 0.07) (1.05,-0.05) ellipse (0.06 and 0.04) (0.87,-0.2) ellipse (0.10 and 0.07) (0.87,-0.2) ellipse (0.06 and 0.04);
+ \fill[\duck@prison, even odd rule] (0.72,-0.2) ellipse (0.10 and 0.07) (0.72,-0.2) ellipse (0.06 and 0.04);
+ \fill[\duck@prison,even odd rule,rotate=70](0.4,-1.05) ellipse (0.1 and 0.07) (0.4,-1.05) ellipse (0.06 and 0.04) (0.2,-0.95) ellipse (0.1 and 0.07) (0.2,-0.95) ellipse (0.06 and 0.04) (0.22,-0.58) ellipse (0.1 and 0.07) (0.22,-0.58) ellipse (0.06 and 0.04);
+ \fill[\duck@prison,even odd rule,rotate=110](-0.33,-0.55) ellipse (0.1 and 0.07) (-0.33,-0.55) ellipse (0.06 and 0.04);
+ \begin{scope}
+ \clip[rotate=-12] (0.45,0.15) rectangle (0.63,0.25);
+ \fill[\duck@prison,even odd rule,rotate=110](-0.07,-0.6) ellipse (0.1 and 0.07) (-0.07,-0.6) ellipse (0.06 and 0.04);
+ \end{scope}
+\fi
+%
+% torch %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifduck@torch
+ \fill[red!50!yellow, xscale=0.015, yscale=-0.015,xshift=130,yshift=-5600] \duckpathtorch;
+ \fill[red!25!yellow, xscale=0.01, yscale=-0.01,xshift=1300,yshift=-6600] \duckpathtorch;
+ \fill[white!50!yellow, xscale=0.006, yscale=-0.006,xshift=3700,yshift=-8600] \duckpathtorch;
+ \fill[\duck@torch,rounded corners=1]
+ (1.1,0.96) -- (0.77,0.25) -- (0.83,0.25) -- (1.3,0.86) -- cycle;
+ \fill[\duck@torch,rotate=-28]
+ (0.62,1.32) ellipse (0.2 and 0.08);
+\fi%
+%
+%
%\draw (current bounding box.north west) rectangle (current bounding box.south east);% For debugging bounding boxes
%
}% from `\def\duck@draw{` at the very beginning
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
+% Random ducks
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfmathsetseed{\number\pdfrandomseed}
+
+\pgfmathdeclarerandomlist{head}{{shorthair}{longhair}{crazyhair}{alien}{hat}{cap}{santa}{chef}{graduate}{beret}{magichat}{witch}{crown}{bunny}{peakedcap}{tophat}}
+\pgfmathdeclarerandomlist{accessories}{{glasses}{sunglasses}{icecream}{book}{signpost}{magicwand}{cricket}{rollingpin}{lightsaber}{cake}{pizza}{hockey}{baguette}{football}{mask}{necklace}{milkshake}{wine}{prison}}
+
+\newcommand{\shuffleducks}{%
+ \pgfmathrandomitem{\head}{head}%
+ \edef\randomhead{\head}%
+ \pgfmathrandomitem{\accessories}{accessories}%
+ \edef\randomaccessories{\accessories}%
+}
+
+\newcommand{\randuck}{%
+ \shuffleducks%
+ \duck[\randomhead, \randomaccessories]%
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
% Defining some of the more complicate paths for easy reuse
%
% naming scheme is \duckpath<name>
@@ -624,11 +845,11 @@
(1.8123,1.2244) .. controls (1.7022,1.2488) and (1.5688,1.2663) ..
(1.5063,1.3739) .. controls (1.4619,1.5143) and (1.4696,1.6649) ..
(1.4340,1.8076) .. controls (1.2524,2.5117) and (0.2335,2.2794) ..
- (0.4148,1.5991) .. controls (0.4341,1.8793) and (0.6629,2.1130) ..
+ (0.4060,1.5991) .. controls (0.4341,1.8793) and (0.6629,2.1130) ..
(0.9011,1.9578) .. controls (1.2427,1.7382) and (1.3350,1.4214) ..
- (1.0905,1.0610) .. controls (1.0897,1.0109) and (1.1103,0.9166) ..
+ (1.0905,1.0610) .. controls (1.0597,1.0109) and (1.1103,0.9166) ..
(1.1805,0.8670) .. controls (1.2507,0.8174) and (1.3503,0.7853) ..
- (1.4508,0.7565) -- cycle
+ (1.4508,0.7565) -- cycle;
}
\newcommand{\duckpathcrazyhair}{%
@@ -669,6 +890,14 @@
(0.71,2.06) -- cycle
}
+\newcommand{\duckpathtorch}{%
+ (90.5,127.8) .. controls (90.3,137.0) and (84.7,136.2) ..
+ (77.9,146.3) .. controls (71.1,136.3) and (66.4,136.9) ..
+ (65.9,127.9) .. controls (65.2,118.1) and (79.2,118.5) ..
+ (78.2,103.8) .. controls (82.2,108.8) and (90.8,111.5) ..
+ (90.5,127.8) -- cycle;
+}
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 32237378723223
% 23737232212232237822