% Florian Sihler, 2022 % Licensed under GNU General Public License version 3 % https://opensource.org/licenses/gpl-3.0.html \def\tikzpingus@filename{tikzpingus} \ProvidesPackage{\tikzpingus@filename}[2023/09/17 version v1.1 Penguins in TikZ] \newif\ifpengu@setup@glows@ \DeclareOption{glows}{\pengu@setup@glows@true}\DeclareOption{noglows}{\pengu@setup@glows@false} \newif\ifpengu@setup@manual@layers@ \DeclareOption{manual-layers}{\pengu@setup@manual@layers@true}\DeclareOption{nomanual-layers}{\pengu@setup@manual@layers@false} \newif\ifpengu@setup@bare@ \DeclareOption{bare}{\pengu@setup@bare@true}\DeclareOption{nobare}{\pengu@setup@bare@false} \ProcessOptions* \RequirePackage{etoolbox} \RequirePackage{tikz} \usetikzlibrary{intersections,shadings,patterns.meta,decorations.pathmorphing,shapes.symbols,shapes.geometric} \pgfdeclarelayer{background}\pgfdeclarelayer{foreground}\pgfdeclarelayer{middle} \pgfdeclarelayer{very-background} \ifpengu@setup@manual@layers@\else \pgfsetlayers{very-background,background,main,middle,foreground} \fi % #region whole setup % \def\@pingu@color@ #1#2(#3,#4,#5){\definecolor{pingu@#1}{#2}{#3,#4,#5}} \@pingu@color@{main}RGB(3,14,29) \@pingu@color@{black}RGB(23,19,19) \@pingu@color@{silver}RGB(192,192,192) \@pingu@color@{bronze}RGB(205,127,50) \@pingu@color@{white}RGB(248,248,248) \@pingu@color@{yellow}RGB(252,187,21) \@pingu@color@{lightblue}RGB(174,229,243) \@pingu@color@{blue}RGB(48,161,247) \@pingu@color@{green}RGB(129,204,41) \@pingu@color@{red}RGB(217, 40, 28) \@pingu@color@{purple}RGB(244,48,93) \def\@pingu@none{!hide} % <@color definitions> % #region lengths and dimens \newdimen\pingu@one@eight \pingu@one@eight=.125cm % constants to save tokens \newdimen\pingu@one \pingu@one=1mm \newdimen\pingu@w@half \pingu@w@half=.9375cm \newdimen\pingu@head@h@half \pingu@head@h@half=.9\pingu@w@half \newdimen\pingu@side@h@half \pingu@side@h@half=1.275cm \newdimen\pingu@bend \pingu@bend=\pingu@one@eight \newdimen\pingu@lower@off \pingu@lower@off=.25cm \newdimen\pingu@outer@off \pingu@outer@off=.25cm \def\basicfeetbend{45} \newdimen\pingu@foot@outer@w \pingu@foot@outer@w=4.5mm \newdimen\pingu@foot@outer@h \pingu@foot@outer@h=.25cm \newdimen\pingu@headcon@x \pingu@headcon@x=.39375cm% .75*.525cm \newdimen\pingu@headcon@y \pingu@headcon@y=.46735cm%.719*.65cm \newdimen\pingu@foot@inner@w \pingu@foot@inner@w=.55cm \newdimen\pingu@foot@inner@h \pingu@foot@inner@h=.115cm \newdimen\pingu@foot@single@w \pingu@foot@single@w=.105cm \newdimen\pingu@foot@single@h \pingu@foot@single@h=2mm \def\eyebaseang{38.5} \newdimen\pingu@eye@shift \pingu@eye@shift=.8mm \def\pinguanglehl{.93} \def\pinguanglehr{.07} % #endregion % #region selections \def\pingu@csappto#1#2{\expandafter\ifx\csname #1\endcsname\@empty\@namedef{#1}{#2}\else\expandafter\g@addto@macro\csname #1\endcsname{, #2}\fi} \def\pingu@create@sel@err#1#2{% \PackageError{\tikzpingus@filename}{There is no '#2' drawer for '#1'. Choose one of '\@nameuse{@pingu@#1@}'}{Or ask the package maintainer :D}% } \def\pingu@@select#1#2{\expandafter\let\csname @pingu@drawer@#2@\expandafter\endcsname\csname @pingu@drawer@#2@#1@\endcsname \expandafter\def\csname @pingu@select@#2@\expandafter\endcsname{#1}} % #1 name | none default \def\pingu@create@selection#1#2{% \expandafter\newcount\csname pc@#1@max\endcsname \expandafter\let\csname @pingu@#1@\endcsname\@empty \expandafter\long\expandafter\def\csname pingu@#1@add\endcsname##1##2{% \ifcsname @pingu@drawer@#1@##1@\endcsname\else% do not re-append! \pingu@csappto{@pingu@#1@}{"##1"} \expandafter\global\expandafter\advance\csname pc@#1@max\endcsname1\relax\fi \expandafter\long\expandafter\def\csname @pingu@drawer@#1@##1@\endcsname{##2}% } \expandafter\def\csname pingu@#1@select\endcsname##1{% \def\@tmp{##1}\ifx\@pingu@random\@tmp% if random is selected, we choose random from pack in @pingu@#1@ % we could do this with pgfmathdeclarerandomlist, but this requires more, % at the moment, i do not care about efficiency, and we do a foreach % we do not pick none for random \edef\@arr{{\csname @pingu@#1@\endcsname}}% % we use 1 as minimum, because 0 is ALWAYS 'none' by definition \pgfmathrandominteger{\@ars}{1}{\csname pc@#1@max\endcsname-1}% \pgfmathsetmacro\@sel{\@arr[\@ars]}% \expandafter\pingu@@select\expandafter{\@sel}{#1}% consolidate the choice in case of multiple \else\ifcsname @pingu@drawer@#1@##1@\endcsname \pingu@@select{##1}{#1}% \else\pingu@create@sel@err{#1}{##1}\fi\fi }% \csname pingu@#1@add\endcsname{none}{#2}% } \def\@pingu@random{!random} \long\def\pingu@create@extra#1#2#3{\expandafter\newif\csname if@pingu@x@#1@\endcsname\pgfqkeys{/pingu}{#2,extra defaults/.append style={#3}}} \def\pingu@set@extra#1#2{\csname @pingu@x@#1@#2\endcsname} % \pingu@create@selection{lefteye}{% \path ([yshift=.75mm,xshift=\pingu@eye@shift]\pingu@name-eye-back-left) coordinate (\pingu@name-eye-left);% } \pingu@create@selection{righteye}{% \path ([yshift=.75mm,xshift=-\pingu@eye@shift]\pingu@name-eye-back-right) coordinate (\pingu@name-eye-right);% } % <@eyes selectors> \pingu@create@selection{leftwing}{% \path ([yshift=-6.5mm]\pingu@name-wings-side-left) coordinate (\pingu@name-wing-left-start) coordinate (\pingu@name-wing-left-tip) coordinate (\pingu@name-wing-left);% } \pingu@create@selection{rightwing}{% \path ([yshift=-6.5mm]\pingu@name-wings-side-right) coordinate (\pingu@name-wing-right-start) coordinate (\pingu@name-wing-right-tip) coordinate (\pingu@name-wing-right);% } \pingu@create@selection{hairstyle}{} % \pingu@create@selection{bill}{% \coordinate (\pingu@name-bill-bottom) at (\pingu@name-bill);% } % <@bill selector> % \pingu@create@selection{leftfoot}{} \pingu@create@selection{rightfoot}{} % <@feet selectors> % \pingu@create@selection{bodytype}{\pingu@x@bodytype@none} % <@bodytype selector> % #endregion % #region key setup % \def\pingu@color#1#2{% \expandafter\def\csname pingu@color@#1\endcsname{#2}% } % <@pingu@color> % HACK: store scale \pgfqkeys{/tikz}{scale/.append code={\def\pingu@default@scale{#1}}} \def\pingu@default@scale{1} \newif\if@pingu@draw@metadots \newif\if@pingu@wi@flip@left \newif\if@pingu@wi@flip@right % \newif\if@pingu@feet@front % <@feet conditional> \pgfqkeys{/pingu}{ /pingu/.search also={/tikz,/pgf}, name/.code = \def\pingu@name{#1}, scale/.code = \def\pingu@scale{#1}, @post/.code = \def\pingu@post{#1}, @body@app/.code = \def\pingu@body@app{#1}, meta dots/.forward to = /pingu/meta-dots, meta-dots/.is if = @pingu@draw@metadots, meta-dots/.default = true, @pingu@all/.style = {}, @block/.style = {/pingu/@pingu@all=#1, fill=#1}, @draw/.style = {/pingu/@pingu@all=#1, cap=round, draw=#1}, @text/.style = {transform shape,text=\pingu@color@body@main}, @body/.style = {}, @extras/.style = {}, @extras@above/.style = {}, @extras@below/.style = {}, @eyes/.style = {}, @belly/.style = {}, @wings/.style = {}, @wingitems/.style = {}, @feet/.style = {}, @bill/.style = {}, @hair/.style = {}, @clip even odd rule/.code = {\pgfseteorule}, % Credit to Andrew Stacey @invclip/.style = {clip,insert path=[/pingu/@clip even odd rule]{[reset cm](-\maxdimen,-\maxdimen)rectangle(\maxdimen,\maxdimen)}}, @pingu/.style = {}, @pingu@main/.style = {}, % left foot color/.code = \pingu@color{foot@left}{#1}, left foot/.code = \pingu@leftfoot@select{#1}, right foot color/.code = \pingu@color{foot@right}{#1}, right foot/.code = \pingu@rightfoot@select{#1}, feet/.style = { /pingu/left foot={#1}, /pingu/right foot={#1} }, feet color/.style = { /pingu/left foot color={#1}, /pingu/right foot color={#1} }, feet front/.is if = @pingu@feet@front, % <@feet keys> % body type/.code = \pingu@bodytype@select{#1}, body main/.code = \pingu@color{body@main}{#1}, body head/.code = \pingu@color{body@head}{#1}, body/.style = {/pingu/body main={#1}, /pingu/body head={#1}}, body front/.code = \pingu@color{body@front}{#1}, % <@bodytype keys> % belly belly/.forward to = /pingu/belly text, belly text/.style = {/pingu/belly raw={\node[/pingu/@text,opacity=.2] {#1};}}, belly raw/.code = \def\pingu@belly@raw{#1}, % left eye/.code = \pingu@lefteye@select{#1}, left eye color/.code = \pingu@color{eye@left}{#1}, left eye second color/.code = \pingu@color{eye@second@left}{#1}, right eye/.code = \pingu@righteye@select{#1}, right eye color/.code = \pingu@color{eye@right}{#1}, right eye second color/.code = \pingu@color{eye@second@right}{#1}, eyes/.style = { /pingu/left eye = {#1}, /pingu/right eye = {#1} }, eyes color/.style = { /pingu/left eye color = {#1}, /pingu/right eye color = {#1} }, eyes second color/.style = { /pingu/left eye second color = {#1}, /pingu/right eye second color = {#1} }, % <@eyes keys> % wings left wing color/.code = \pingu@color{left@wing}{#1}, left wing/.code = \pingu@leftwing@select{#1}, right wing color/.code = \pingu@color{right@wing}{#1}, right wing/.code = \pingu@rightwing@select{#1}, wings/.style = {/pingu/left wing={#1}, /pingu/right wing={#1}}, wings color/.style = {/pingu/left wing color={#1}, /pingu/right wing color={#1}}, left item angle/.forward to = /pingu/left wing item angle, left wing item angle/.code = {\def\pingu@wing@left@item@angle@user{#1}},% left item flip/.forward to = /pingu/left wing item flip, left wing item flip/.is if = @pingu@wi@flip@left, right item angle/.forward to = /pingu/right wing item angle, right item flip/.forward to = /pingu/right wing item flip, right wing item angle/.code = {\def\pingu@wing@right@item@angle@user{#1}},% right wing item flip/.is if = @pingu@wi@flip@right, % bill/.code = \pingu@bill@select{#1}, bill color/.code = \pingu@color{bill}{#1}, % <@bill keys> % hair color TODO: other colors hair/.forward to = /pingu/hairs color, hairs/.forward to = /pingu/hairs color, hair 1 color/.code = \pingu@color{hair@a}{#1}, hair 1/.forward to = /pingu/hair 1 color, hair 2 color/.code = \pingu@color{hair@b}{#1}, hair 2/.forward to = /pingu/hair 2 color, hair 3 color/.code = \pingu@color{hair@c}{#1}, hair 3/.forward to = /pingu/hair 3 color, hair 4 color/.code = \pingu@color{hair@d}{#1}, hair 4/.forward to = /pingu/hair 4 color, hair 5 color/.code = \pingu@color{hair@e}{#1}, hair 5/.forward to = /pingu/hair 5 color, hairs color/.style = {/pingu/hair 1 color={#1}, /pingu/hair 2 color={#1}, /pingu/hair 3 color={#1}, /pingu/hair 4 color={#1}, /pingu/hair 5 color={#1}}, hair style/.forward to = /pingu/hairstyle, hairstyle/.code = \pingu@hairstyle@select{#1}, % size height/.code = \setlength{\pingu@side@h@half}{#1},% small height/.forward to = /pingu/small size, small/.forward to = /pingu/small size, small size/.style = {/pingu/height=11mm}, normal height/.forward to = /pingu/normal size, normal/.forward to = /pingu/normal size, normal size/.style = {/pingu/height=1.275cm}, large height/.forward to = /pingu/large size, large/.forward to = /pingu/large size, large size/.style = {/pingu/height=15mm}, random from/.code = {\pgfmathdeclarerandomlist{@tmp}{#1}\pgfmathrandomitem{\@tmp}{@tmp}\edef\tmp{\noexpand\@pingu@set{\@tmp}}\tmp}, defaults/.style = {% name=pingu, feet=normal, feet color=pingu@yellow, body=pingu@main, body type=normal,@post={},@body@app={}, body front=pingu@white,% eyes=normal, eyes color=pingu@black, eyes second color=pingu@white, bill=normal, bill color=pingu@yellow, wings=normal, wings color=\pingu@color@body@main, hairstyle=normal, hairs color=\pingu@color@body@main, belly raw={}, scale=\pingu@default@scale, left wing item angle=0,right wing item angle=0,extra defaults,user defaults,% feet front=false% }, user defaults/.style = {}, % will be set individually extra defaults/.style = {} } \def\@pingu@set#1{\pgfqkeys{/pingu}{#1}} \def\pingudefaults#1{\pgfqkeys{/pingu}{user defaults/.style={#1}}} \def\pingudefaultsappend#1{\pgfqkeys{/pingu}{user defaults/.append style={#1}}} % #endregion % #region subenvs \def\pingu@layer#1[#2]{\pgfonlayer{#1}\scope[/pingu/@pingu,#2]} \def\endpingu@layer{\endscope\endpgfonlayer} % #endregion % colorname | mix with \def\@pingu@color@mixwith#1#2{\protected@edef\@tmp{#1}\ifx\@tmp\@pingu@none\else\expandafter\def\expandafter#1\expandafter{#1!#2}\fi} % #region complete sets and styles \newif\if@pingu@do@back@ \pgfqkeys{/pingu}{ :line/.style = {/pingu/@block/.append style={fill=none,draw=##1!80!black,shade=none,path fading=none}}, :fill/.style = {/pingu/body=#1,/pingu/body front=#1,/pingu/feet color=#1, /pingu/bill color=#1, /pingu/eyes color=#1, /pingu/eyes second color=#1}, :fill/.default = pingu@main, :pingu/.style = {/pingu/@body/.style={#1},/pingu/@wings/.style={#1},/pingu/@eyes/.style={#1},/pingu/@bill/.style={#1},/pingu/@hair/.style={#1},/pingu/@feet/.style={#1}}, :mix-draw/.style = {:pingu={/pingu/@block/.append style={/pingu/@pingu@all={####1!#1}, fill={####1!#1}}}}, :mix-draw/.default = 50!white, :mix-all/.style = {/pingu/@block/.append style={/pingu/@pingu@all={##1!#1}, fill={##1!#1}},/pingu/@draw/.append style={/pingu/@pingu@all={##1!#1}, draw={##1!#1}}}, :mix-all/.default = 50!white, :mix/.style = { /pingu/@body/.code={\@pingu@color@mixwith\pingu@color@body@main{#1}\@pingu@color@mixwith\pingu@color@body@head{#1}}, /pingu/@wings/.code={\@pingu@color@mixwith\pingu@color@left@wing{#1}\@pingu@color@mixwith\pingu@color@right@wing{#1}}, /pingu/@eyes/.code={\@pingu@color@mixwith\pingu@color@eye@left{#1}\@pingu@color@mixwith\pingu@color@eye@right{#1}\@pingu@color@mixwith\pingu@color@eye@second@left{#1}\@pingu@color@mixwith\pingu@color@eye@second@right{#1}}, /pingu/@bill/.code={\@pingu@color@mixwith\pingu@color@bill{#1}}, /pingu/@hair/.code={\@pingu@color@mixwith\pingu@color@hair@a{#1}\@pingu@color@mixwith\pingu@color@hair@b{#1}\@pingu@color@mixwith\pingu@color@hair@c{#1}\@pingu@color@mixwith\pingu@color@hair@d{#1}\@pingu@color@mixwith\pingu@color@hair@e{#1}}, /pingu/@feet/.code={\@pingu@color@mixwith\pingu@color@foot@left{#1}\@pingu@color@mixwith\pingu@color@foot@right{#1}} }, :mix/.default = 50!white, :ghost parts/.style = {/pingu/@pingu@all/.append style={opacity={#1}}}, :ghost parts/.default = {.5}, :ghost/.style = {/pingu/@pingu/.append style={opacity=#1,transparency group}}, :ghost/.default = {.5}, :ghost glow/.style = {/pingu/@pingu/.append style={opacity=#1,transparency group},/pingu/@block/.append style={/pingu/@glow}}, :ghost glow/.default = {.5}, :devil/.style = {/pingu/devil horns=#1,/pingu/eyes devil=#1}, :devil/.default = pingu@purple, :hide/.style = {/pingu/body type=none,/pingu/hair=\@pingu@none,/pingu/feet=none,/pingu/wings=none,/pingu/bill=none,/pingu/eyes=none}, :back/.code = {\pgfqkeys{/pingu}{eyes=none,bill=none,body front=\pingu@color@body@main,@pingu@main/.append style={xshift=2\pingu@w@half,xscale=-1},feet back}\gdef\pingu@back@init@call{\pgfsetlayers{foreground,middle,main,background}\gdef\pingu@back@init@call{}}\@pingu@do@back@true}% TODO: back foot clipping? }% TODO: draw another penguin that is then drawn above with only back \let\pingu@back@init@call\@empty % #endregion % #region glows \ifpengu@setup@glows@ \usetikzlibrary{fadings}% \tikzfading[name=pingu@halo fade out,inner color=transparent!39,outer color=transparent!100] \pgfqkeys{/pingu}{@glow/.style={path fading={pingu@halo fade out},#1}} \else \pgfqkeys{/pingu}{@glow/.style={}} \fi % #endregion % #endregion % #region core % #region path commands \long\def\pingu@path{\@dblarg\pingu@path@} \def\pingu@path@[#1]#2#3;{\protected@edef\@tmp{#2}\ifx\@tmp\@pingu@none\else\path[#1,#2] #3;\fi} \long\def\pingu@block{\@dblarg\pingu@block@} \def\pingu@block@[#1]#2#3;{\protected@edef\@tmp{#2}\ifx\@tmp\@pingu@none\else\path[#1,/pingu/@block=#2] #3;\fi} \long\def\pingu@draw{\@dblarg\pingu@draw@} \def\pingu@draw@[#1]#2#3;{\protected@edef\@tmp{#2}\ifx\@tmp\@pingu@none\else\path[#1,/pingu/@draw=#2] #3;\fi} % #endregion \newcommand*\pingu[1][]{% \ifpengu@setup@manual@layers@\pgfsetlayers{background,main,middle,foreground}\fi\begingroup \@pingu@do@back@false \pgfqkeys{/pingu}{defaults, #1}% \ifdim\pingu@side@h@half<10.33mm \PackageWarning{\tikzpingus@filename}{Penguins with a height below 10.33mm may have unwanted artifacts.}\fi \scope[/pingu/@pingu,/pingu/@pingu@main] \scope[/pingu/@body] \@pingu@drawer@bodytype@ \pingu@body@app \endscope \path (\pingu@name-head-center)++(0,-.05mm-\pingu@outer@off) coordinate (\pingu@name-bill); \scope[shift=(\pingu@name-belly-center),/pingu/@belly] \clip[use path=\pingu@whitepingu]; \pingu@belly@raw \endscope \coordinate (\pingu@name-head) at (\pingu@w@half,.7375cm); \scope[/pingu/@eyes] \@pingu@drawer@lefteye@ \@pingu@drawer@righteye@ \endscope \pingu@layer{background}[]\pingu@draw@clothing@behind\endpingu@layer \pingu@draw@clothing@middle \scope[/pingu/@extras,/pingu/@extras@below] \pingu@draw@extras@below \endscope \scope[/pingu/@hair] \@pingu@drawer@hairstyle@ \endscope \if@pingu@feet@front\else\pingu@layer{background}[]\fi \scope[/pingu/@feet] \@pingu@drawer@leftfoot@ \@pingu@drawer@rightfoot@ \endscope \if@pingu@feet@front\else\endpingu@layer\fi \scope[/pingu/@wings] \@pingu@drawer@leftwing@ \@pingu@drawer@rightwing@ \endscope \path (\pingu@name-wing-left-start) -- (\pingu@name-wing-left) -- ([turn]\csname @pingu@wingdown@\@pingu@select@leftwing@ @\endcsname:2.45mm) coordinate (\pingu@name-wing-left-low) -- ([turn]180:4.9mm) coordinate (\pingu@name-wing-left-up); \path (\pingu@name-wing-left-start) -- (\pingu@name-wing-left) -- (\pingu@name-wing-left-start) -- ([turn]-180+\csname @pingu@wingdown@\@pingu@select@leftwing@ @\endcsname:3.45mm) coordinate (\pingu@name-wing-left-start-low) -- ([turn]180:6.9mm) coordinate (\pingu@name-wing-left-start-up); \path (\pingu@name-wing-right-start) -- (\pingu@name-wing-right) -- ([turn]-\csname @pingu@wingdown@\@pingu@select@rightwing@ @\endcsname:2.45mm) coordinate (\pingu@name-wing-right-low) -- ([turn]180:4.9mm) coordinate (\pingu@name-wing-right-up); % double path to fix turn \path (\pingu@name-wing-right-start) -- (\pingu@name-wing-right) -- (\pingu@name-wing-right-start) -- ([turn]180-\csname @pingu@wingdown@\@pingu@select@rightwing@ @\endcsname:3.45mm) coordinate (\pingu@name-wing-right-start-low) -- ([turn]180:6.9mm) coordinate (\pingu@name-wing-right-start-up); \pingu@draw@clothing@main \scope[/pingu/@bill] \@pingu@drawer@bill@ \endscope \scope[/pingu/@extras,/pingu/@extras@above] \pingu@draw@extras@above \endscope \scope[/pingu/@wingitems] \pingu@draw@wing@items \endscope \endscope \if@pingu@draw@metadots \@pingu@draw@dots \fi \pingu@post \endgroup \pingu@back@init@call } \let\pengu\pingu% as an alias % #region lower-pingu % Note: to be used in clippies \def\pingu@path@lowerpingu{(0,\pingu@outer@off) % left side to[bend right=\pingu@bend] ++(0,-\pingu@side@h@half-\pingu@outer@off) % feety stuff arc (180:270:\pingu@foot@outer@w{} and \pingu@foot@outer@h) arc (270:332:\pingu@foot@inner@w{} and \pingu@foot@inner@h) arc (208:270:\pingu@foot@inner@w{} and \pingu@foot@inner@h) arc (270:360:\pingu@foot@outer@w{} and \pingu@foot@outer@h)% % right side to[bend right=\pingu@bend] ++(0,\pingu@side@h@half+\pingu@outer@off) arc(0:180:\pingu@w@half{} and \pingu@head@h@half) -- cycle}% arc clip to secure wings \def\pingu@path@upperpingu{(\pingu@name-head-center) ellipse [x radius=\pingu@w@half, y radius=\pingu@head@h@half]} % #endregion % #endregion % #region main body parts % #region body front % #region normal \pingu@bodytype@add{normal}{% \pingu@block[save path=\pingu@lowerpingu]{\pingu@color@body@main} (0,\pingu@outer@off) % left side to[bend right=\pingu@bend] coordinate[pos=.775] (\pingu@name-waist-right) ++(0,-\pingu@side@h@half-\pingu@outer@off) % feety stuff arc (180:270:\pingu@foot@outer@w{} and \pingu@foot@outer@h) coordinate (\pingu@name-foot-right) arc (270:332:\pingu@foot@inner@w{} and \pingu@foot@inner@h) coordinate (\pingu@name-bottom-center) arc (208:270:\pingu@foot@inner@w{} and \pingu@foot@inner@h) coordinate (\pingu@name-foot-left) arc (270:360:\pingu@foot@outer@w{} and \pingu@foot@outer@h)% % right side to[bend right=\pingu@bend] coordinate[pos=.225] (\pingu@name-waist-left) ++(0,\pingu@side@h@half+\pingu@outer@off) % coordinate coordinate (\pingu@name-wings-side-left) -- (0,\pingu@outer@off) coordinate (\pingu@name-wings-side-right) coordinate[pos=.5] (\pingu@name-head-center) -- cycle; \pingu@block[save path=\pingu@upperpingu]{\pingu@color@body@head} (\pingu@name-head-center) ++(0,\pingu@head@h@half) coordinate (\pingu@name-head-top) arc(90:450:\pingu@w@half{} and \pingu@head@h@half) coordinate[pos=\pinguanglehr] (\pingu@name-head-right) coordinate[pos=\pinguanglehl] (\pingu@name-head-left); \coordinate (\pingu@name-belly-back) at (\pingu@w@half,-1cm); \coordinate (\pingu@name-belly-center) at (\pingu@w@half,-.68\pingu@side@h@half); \pingu@block[save path=\pingu@whitepingu]{\pingu@color@body@front} (\pingu@name-belly-back)++(-\pingu@w@half+\pingu@one,\pingu@lower@off) to[bend right=.8\pingu@bend] ++(0,1.05cm-\pingu@side@h@half-\pingu@lower@off) arc (180:270:4mm and 2mm) arc (270:331:5mm and .85mm) arc (207:270:5mm and .85mm) arc (270:360:4mm and 2mm) to[bend right=.8\pingu@bend] ++(0,\pingu@side@h@half-1.05cm+\pingu@lower@off) arc (0:180:\pingu@w@half-.96mm and \pingu@w@half-\pingu@one) -- cycle; \coordinate (\pingu@name-eye-back-right) at ([xshift=-.275cm,yshift=.25cm-\pingu@outer@off]\pingu@name-head-center); \coordinate (\pingu@name-eye-back-left) at ([xshift=.275cm,yshift=.25cm-\pingu@outer@off]\pingu@name-head-center); \coordinate (\pingu@name-head-back-con-right) at ([xshift=-\pingu@headcon@x,yshift=-\pingu@headcon@y]\pingu@name-eye-back-right); \coordinate (\pingu@name-head-back-con-left) at ([xshift=\pingu@headcon@x,yshift=-\pingu@headcon@y]\pingu@name-eye-back-left); \pingu@block{\pingu@color@body@front} (\pingu@name-eye-back-right)++(0,-.25mm) ellipse [x radius=.525cm,y radius=.625cm]; \pingu@block{\pingu@color@body@front} (\pingu@name-eye-back-left)++(0,-.25mm) ellipse [x radius=.525cm,y radius=.625cm]; } % #endregion % #region none % \def\pingu@x@bodytype@none{% % set the lower half \path[save path=\pingu@lowerpingu] (0,\pingu@outer@off) % left side to[bend right=\pingu@bend] coordinate[pos=.775] (\pingu@name-waist-right) ++(0,-\pingu@side@h@half-\pingu@outer@off) % feety stuff arc (180:270:\pingu@foot@outer@w{} and \pingu@foot@outer@h) coordinate (\pingu@name-foot-right) arc (270:332:\pingu@foot@inner@w{} and \pingu@foot@inner@h) coordinate (\pingu@name-bottom-center) arc (208:270:\pingu@foot@inner@w{} and \pingu@foot@inner@h) coordinate (\pingu@name-foot-left) arc (270:360:\pingu@foot@outer@w{} and \pingu@foot@outer@h) % right side to[bend right=\pingu@bend] coordinate[pos=.225] (\pingu@name-waist-left) ++(0,\pingu@side@h@half+\pingu@outer@off) % switch to left coordinate (\pingu@name-wings-side-left) -- (0,\pingu@outer@off) coordinate[pos=.5] (\pingu@name-head-center) coordinate (\pingu@name-wings-side-right) -- cycle; % set the upper half \path[save path=\pingu@upperpingu] (\pingu@name-head-center) ++(0,\pingu@head@h@half) coordinate (\pingu@name-head-top) arc(90:450:\pingu@w@half{} and \pingu@head@h@half) coordinate[pos=\pinguanglehr] (\pingu@name-head-right) coordinate[pos=\pinguanglehl] (\pingu@name-head-left); \coordinate (\pingu@name-belly-back) at (\pingu@w@half,-1cm); \coordinate (\pingu@name-belly-center) at (\pingu@w@half,-.68\pingu@side@h@half); % set the white above \path[save path=\pingu@whitepingu] (\pingu@name-belly-back) ++(-\pingu@w@half+\pingu@one,\pingu@lower@off) to[bend right=.8\pingu@bend] ++(0,1.05cm-\pingu@side@h@half-\pingu@lower@off) arc (180:270:4mm and 2mm) arc (270:331:5mm and .85mm) arc (207:270:5mm and .85mm) arc (270:360:4mm and 2mm) to[bend right=.8\pingu@bend] ++(0,\pingu@side@h@half-1.05cm+\pingu@lower@off) arc (0:180:\pingu@w@half-.96mm and \pingu@w@half-\pingu@one) -- cycle; \coordinate (\pingu@name-eye-back-right) at ([xshift=-.275cm,yshift=.25cm-\pingu@outer@off]\pingu@name-head-center); \coordinate (\pingu@name-eye-back-left) at ([xshift=.275cm,yshift=.25cm-\pingu@outer@off]\pingu@name-head-center); \coordinate (\pingu@name-head-back-con-right) at ([xshift=-\pingu@headcon@x,yshift=-\pingu@headcon@y]\pingu@name-eye-back-right); \coordinate (\pingu@name-head-back-con-left) at ([xshift=\pingu@headcon@x,yshift=-\pingu@headcon@y]\pingu@name-eye-back-left); } % <@pingu@x@bodytype@none> % #endregion % #region chubby \pingu@bodytype@add{chubby}{% \pingu@block[save path=\pingu@lowerpingu]{\pingu@color@body@main} (0,\pingu@outer@off) % left side to[bend right=1.65*\pingu@bend] coordinate[pos=.775] (\pingu@name-waist-right) ++(0,-\pingu@side@h@half-\pingu@outer@off) % feety stuff arc (180:270:\pingu@foot@outer@w{} and \pingu@foot@outer@h-.35mm) coordinate (\pingu@name-foot-right) arc (270:332:\pingu@foot@inner@w{} and 1.25*\pingu@foot@inner@h) coordinate (\pingu@name-bottom-center) arc (208:270:\pingu@foot@inner@w{} and 1.25*\pingu@foot@inner@h) coordinate (\pingu@name-foot-left) arc (270:360:\pingu@foot@outer@w{} and \pingu@foot@outer@h-.35mm)% % right side to[bend right=1.65*\pingu@bend] coordinate[pos=.225] (\pingu@name-waist-left) ++(0,\pingu@side@h@half+\pingu@outer@off) % coordinate coordinate (\pingu@name-wings-side-left) -- (0,\pingu@outer@off) coordinate (\pingu@name-wings-side-right) coordinate[pos=.5] (\pingu@name-head-center) -- cycle; \pingu@block[save path=\pingu@upperpingu]{\pingu@color@body@head} (\pingu@name-head-center) ++(0,\pingu@head@h@half) coordinate (\pingu@name-head-top) arc(90:450:\pingu@w@half{} and \pingu@head@h@half) coordinate[pos=\pinguanglehr] (\pingu@name-head-right) coordinate[pos=\pinguanglehl] (\pingu@name-head-left); \coordinate (\pingu@name-belly-back) at (\pingu@w@half,-.97cm); \coordinate (\pingu@name-belly-center) at (\pingu@w@half,-.65\pingu@side@h@half); \pingu@block[save path=\pingu@whitepingu]{\pingu@color@body@front} (\pingu@name-head-center)++(-\pingu@w@half+2.5\pingu@one,-4.25mm) coordinate (@) to[bend right=19] ([xshift=-1.25mm,yshift=1.5\pingu@one]@|-\pingu@name-bottom-center) arc (180:270:4.675mm and 1mm) arc (270:331:4mm and 1.15mm) arc (207:270:4mm and 1.15mm) arc (270:360:4.675mm and 1mm) to[bend right=19] ([xshift=\pingu@w@half-2.5\pingu@one,yshift=-4.25mm]\pingu@name-head-center) ; \coordinate (\pingu@name-eye-back-right) at ([xshift=-.275cm,yshift=.25cm-\pingu@outer@off]\pingu@name-head-center); \coordinate (\pingu@name-eye-back-left) at ([xshift=.275cm,yshift=.25cm-\pingu@outer@off]\pingu@name-head-center); \coordinate (\pingu@name-head-back-con-right) at ([xshift=-\pingu@headcon@x,yshift=-\pingu@headcon@y]\pingu@name-eye-back-right); \coordinate (\pingu@name-head-back-con-left) at ([xshift=\pingu@headcon@x,yshift=-\pingu@headcon@y]\pingu@name-eye-back-left); \pingu@block{\pingu@color@body@front} (\pingu@name-eye-back-right)++(0,-.5mm) ellipse [x radius=.525cm,y radius=.6cm]; \pingu@block{\pingu@color@body@front} (\pingu@name-eye-back-left)++(0,-.5mm) ellipse [x radius=.525cm,y radius=.6cm]; } % #endregion % #region legacy \pingu@bodytype@add{legacy}{% \pingu@block[save path=\pingu@lowerpingu]{\pingu@color@body@main} (0,\pingu@outer@off) % left side to[bend right=1.25*\pingu@bend] coordinate[pos=.77] (\pingu@name-waist-right) ++(0,-.95\pingu@side@h@half-\pingu@outer@off+.65\pingu@one) coordinate (@b) % for bottom clip % feety stuff to[out=270,in=270] coordinate[pos=.3,yshift=-.25mm] (\pingu@name-foot-right) coordinate[pos=.5,yshift=.875\pingu@one] (\pingu@name-bottom-center) coordinate[pos=.7,yshift=-.25mm] (\pingu@name-foot-left) ++(2*\pingu@w@half,0) % right side to[bend right=1.25*\pingu@bend] coordinate[pos=.225] (\pingu@name-waist-left) ++(0,.95\pingu@side@h@half+\pingu@outer@off-.65\pingu@one) % coordinate coordinate (\pingu@name-wings-side-left) -- (0,\pingu@outer@off) coordinate (\pingu@name-wings-side-right) coordinate[pos=.5] (\pingu@name-head-center) -- cycle; \pingu@block[save path=\pingu@upperpingu]{\pingu@color@body@head} (\pingu@name-head-center) ++(0,\pingu@head@h@half) coordinate (\pingu@name-head-top) arc(90:450:\pingu@w@half{} and \pingu@head@h@half) coordinate[pos=\pinguanglehr] (\pingu@name-head-right) coordinate[pos=\pinguanglehl] (\pingu@name-head-left); \coordinate (\pingu@name-belly-back) at (\pingu@w@half,-.97cm); \coordinate (\pingu@name-belly-center) at (\pingu@w@half,-.75\pingu@side@h@half+.325\pingu@one); \pingu@block[save path=\pingu@whitepingu]{\pingu@color@body@front} (\pingu@name-head-center)++(-\pingu@w@half+2.5\pingu@one,-4.25mm) coordinate (@) to[bend right=14] ([xshift=-1.25mm,yshift=.33\pingu@one]@|-@b) to[out=272,in=268] ++(2*\pingu@w@half-2.5\pingu@one,0) to[bend right=14] ([xshift=\pingu@w@half-2.5\pingu@one,yshift=-4.25mm]\pingu@name-head-center) ; \coordinate (\pingu@name-eye-back-right) at ([xshift=-.275cm,yshift=.25cm-\pingu@outer@off]\pingu@name-head-center); \coordinate (\pingu@name-eye-back-left) at ([xshift=.275cm,yshift=.25cm-\pingu@outer@off]\pingu@name-head-center); \coordinate (\pingu@name-head-back-con-right) at ([xshift=-\pingu@headcon@x,yshift=-\pingu@headcon@y]\pingu@name-eye-back-right); \coordinate (\pingu@name-head-back-con-left) at ([xshift=\pingu@headcon@x,yshift=-\pingu@headcon@y]\pingu@name-eye-back-left); \pingu@block{\pingu@color@body@front} (\pingu@name-eye-back-right)++(0,-.5mm) ellipse [x radius=.525cm,y radius=.6cm]; \pingu@block{\pingu@color@body@front} (\pingu@name-eye-back-left)++(0,-.5mm) ellipse [x radius=.525cm,y radius=.6cm]; } % #endregion % #endregion % #region eyes % name core | left | right % \long\def\pingu@eyes@s#1#2#3{% \@ifnextchar[% {\pingu@eyes@s@{#1}{#2}{#3}}% {\pingu@eyes@s@{#1}{#2}{#3}[pingu@black]}% } \long\def\pingu@eyes@s@#1#2#3[#4]{% \pgfqkeys{/pingu}{% left eye #1/.style = {/pingu/left eye={#1}, /pingu/left eye color={##1}}, left eye #1/.default = {#4}, right eye #1/.style = {/pingu/right eye={#1}, /pingu/right eye color={##1}}, right eye #1/.default = {#4}, eyes #1/.style = {/pingu/eyes={#1}, /pingu/eyes color={##1}}, eyes #1/.default = {#4} }% \pingu@lefteye@add{#1}{#2}\pingu@righteye@add{#1}{#3}% } % <@pingu@eyes@s> \pgfqkeys{/pingu}{% eyes none/.style = {eyes=none}, left eye none/.style = {left eye=none}, right eye none/.style = {right eye=none} } % adding the alias % \pingu@eyes@s{normal}{% \pingu@block{\pingu@color@eye@left} ([yshift=.75mm,xshift=\pingu@eye@shift]\pingu@name-eye-back-left) coordinate (\pingu@name-eye-left) ellipse [x radius=.1225cm, y radius=.1365cm]; }{% \pingu@block{\pingu@color@eye@right} ([yshift=.75mm,xshift=-\pingu@eye@shift]\pingu@name-eye-back-right) coordinate(\pingu@name-eye-right) ellipse [x radius=.1225cm, y radius=.1365cm]; } % <@eyes normal> \pingu@eyes@s{vertical}{% \pingu@block{\pingu@color@eye@left} ([yshift=.75mm,xshift=\pingu@eye@shift]\pingu@name-eye-back-left) coordinate (\pingu@name-eye-left) ellipse [x radius=1.13mm, y radius=.145cm]; }{% \pingu@block{\pingu@color@eye@right} ([yshift=.75mm,xshift=-\pingu@eye@shift]\pingu@name-eye-back-right) coordinate(\pingu@name-eye-right) ellipse [x radius=1.13mm, y radius=.145cm]; } % \pingu@eyes@s{shiny}{% \pingu@block{\pingu@color@eye@left} ([yshift=.75mm,xshift=\pingu@eye@shift]\pingu@name-eye-back-left) coordinate(\pingu@name-eye-left) ellipse [x radius=.22cm, y radius=.26cm]; \pingu@block{\pingu@color@eye@second@left} (\pingu@name-eye-left)++(\eyebaseang:.85mm and \pingu@one) ellipse [x radius=.8mm, y radius=\pingu@one]; \pingu@block{\pingu@color@eye@second@left} (\pingu@name-eye-left)++(\eyebaseang+180:.12cm and .14cm) ellipse [x radius=.25mm, y radius=.35mm]; }{% \pingu@block{\pingu@color@eye@right} ([yshift=.75mm,xshift=-\pingu@eye@shift]\pingu@name-eye-back-right) coordinate(\pingu@name-eye-right) ellipse [x radius=.22cm, y radius=.26cm]; \pingu@block{\pingu@color@eye@second@right} (\pingu@name-eye-right)++(\eyebaseang:.85mm and \pingu@one) ellipse [x radius=.8mm, y radius=\pingu@one]; \pingu@block{\pingu@color@eye@second@right} (\pingu@name-eye-right)++(\eyebaseang+180:.12cm and .14cm) ellipse [x radius=.25mm, y radius=.35mm]; } % <@eyes shiny> \pingu@eyes@s{wink}{% \coordinate (\pingu@name-eye-left) at ([yshift=.75mm,xshift=\pingu@eye@shift]\pingu@name-eye-back-left); \pingu@block[rotate around={-4:(\pingu@name-eye-left)}]{\pingu@color@eye@left} (\pingu@name-eye-left)++(174:.14cm and .14cm)++(0,-.065cm) arc (174:6:.14cm and .14cm) arc (-6:-174:.1mm and .08mm) arc (6:174:.12cm and .065cm) arc (-6:-174:.1mm and .08mm) -- cycle; }{% \coordinate (\pingu@name-eye-right) at ([yshift=.75mm,xshift=-\pingu@eye@shift]\pingu@name-eye-back-right); \pingu@block[rotate around={4:(\pingu@name-eye-right)}]{\pingu@color@eye@right} (\pingu@name-eye-right)++(174:.14cm and .14cm)++(0,-.065cm) arc (174:6:.14cm and .14cm) arc (-6:-174:.1mm and .08mm) arc (6:174:.12cm and .065cm) arc (-6:-174:.1mm and .08mm) -- cycle; } \pingu@eyes@s{shock}{% \pingu@block{\pingu@color@eye@left} ([yshift=.75mm,xshift=\pingu@eye@shift]\pingu@name-eye-back-left) coordinate (\pingu@name-eye-left) ellipse [x radius=.1535cm, y radius=.1575cm]; \pingu@block{\pingu@color@eye@second@left} ([yshift=.75mm,xshift=\pingu@eye@shift]\pingu@name-eye-back-left) coordinate (\pingu@name-eye-left) ellipse [x radius=.1325cm, y radius=.1375cm]; }{% \pingu@block{\pingu@color@eye@right} ([yshift=.75mm,xshift=-\pingu@eye@shift]\pingu@name-eye-back-right) coordinate(\pingu@name-eye-right) ellipse [x radius=.1535cm, y radius=.1575cm]; \pingu@block{\pingu@color@eye@second@right} ([yshift=.75mm,xshift=-\pingu@eye@shift]\pingu@name-eye-back-right) coordinate(\pingu@name-eye-right) ellipse [x radius=.1325cm, y radius=.1375cm]; } % \let\pingu@eyes@s\relax % #endregion % #region wings % every wing has to define 1) a base element angle and 2) a marker if before or after the wing \let\pingu@wi@above\iftrue \let\pingu@wi@below\iffalse % name core | left | right | above: \iftrue | angle for items | wing down [left] \long\def\@pingu@wings@s#1#2#3#4#5#6{% \pgfqkeys{/pingu}{% left wing #1/.style = {/pingu/left wing={#1}, /pingu/left wing color={##1}},% left wing #1/.default = \pingu@color@body@main,% right wing #1/.style = {/pingu/right wing={#1}, /pingu/right wing color={##1}},% right wing #1/.default = \pingu@color@body@main,% wings #1/.style = {/pingu/wings={#1}, /pingu/wings color={##1}},% wings #1/.default = \pingu@color@body@main% }% \expandafter\def\csname @pingu@wing@str@#1@\endcsname{#1}% \pingu@leftwing@add{#1}{#2}\pingu@rightwing@add{#1}{#3}% \expandafter\let\csname @pingu@wingitem@#1@\endcsname#4\relax \expandafter\def\csname @pingu@wingangle@items@#1@\endcsname{#5}% \expandafter\def\csname @pingu@wingdown@#1@\endcsname{#6}% } \pgfqkeys{/pingu}{wings none/.style={/pingu/wings=none},left wing none/.style={/pingu/left wing=none},right wing none/.style={/pingu/right wing=none}} % adding the alias \let\@pingu@wingitem@none@\pingu@wi@above \def\@pingu@wingangle@items@none@{90} \def\@pingu@wingdown@none@{90} % #region wings-normal \@pingu@wings@s{normal}{% \coordinate (\pingu@name-wing-left-start) at ([yshift=-6.5mm]\pingu@name-wings-side-left); \scope[xshift=-\p@] % shift to avoid rounding errors in pdf viewers \pgfinterruptboundingbox \path[/pingu/@invclip] \pingu@path@lowerpingu; \endpgfinterruptboundingbox \pingu@block[rotate around={15:(\pingu@name-wing-left-start)}]{\pingu@color@left@wing} (\pingu@name-wing-left-start) ellipse [x radius=.195cm, y radius=9mm] +(-90:.195cm and 9mm) coordinate (\pingu@name-wing-left-tip) +(-90:.145cm and .75cm) coordinate (\pingu@name-wing-left); \endscope}{% \coordinate (\pingu@name-wing-right-start) at ([yshift=-6.5mm]\pingu@name-wings-side-right); \scope[xshift=\p@] % shift to avoid rounding errors in pdf viewers \pgfinterruptboundingbox \path[/pingu/@invclip] \pingu@path@lowerpingu; \endpgfinterruptboundingbox \pingu@block[rotate around={-15:(\pingu@name-wing-right-start)}]{\pingu@color@right@wing} (\pingu@name-wing-right-start) ellipse [x radius=.195cm, y radius=9mm] +(-90:.195cm and 9mm) coordinate (\pingu@name-wing-right-tip) +(-90:.145cm and .75cm) coordinate (\pingu@name-wing-right); \endscope}{\pingu@wi@above}{-5}{-70} % #endregion % #region wings-wave \@pingu@wings@s{wave}{% \coordinate (\pingu@name-wing-left-start) at ([yshift=-5.85mm]\pingu@name-wings-side-left); \scope[xshift=-\p@] % shift to avoid rounding errors in pdf viewers \pgfinterruptboundingbox \path[/pingu/@invclip] \pingu@path@lowerpingu; \endpgfinterruptboundingbox \pingu@block[rotate around={-39:(\pingu@name-wing-left-start)}]{\pingu@color@left@wing} (\pingu@name-wing-left-start) ellipse [x radius=2.2mm, y radius=9.35mm] +(90:.22cm and .935cm) coordinate (\pingu@name-wing-left-tip) +(150:.22cm and .935cm) coordinate (\pingu@name-wing-left-cap-up) +(-3:.22cm and .935cm) coordinate (\pingu@name-wing-left-cap-down) +(90:.175cm and .75cm) coordinate (\pingu@name-wing-left); \pingu@block{\pingu@color@left@wing} (\pingu@name-wing-left-start)++(.03mm,4.6mm) to[out=-80,in=220] (\pingu@name-wing-left-cap-up) -- (\pingu@name-wing-left-start) -- cycle; \pingu@block{\pingu@color@left@wing} (\pingu@name-wing-left-start)++(.085mm,-4.4mm) to[out=80,in=-131] (\pingu@name-wing-left-cap-down) -- (\pingu@name-wing-left-start) -- cycle; \endscope}{% \coordinate (\pingu@name-wing-right-start) at ([yshift=-5.85mm]\pingu@name-wings-side-right); \scope[xshift=\p@] % shift to avoid rounding errors in pdf viewers \pgfinterruptboundingbox \path[/pingu/@invclip] \pingu@path@lowerpingu; \endpgfinterruptboundingbox \pingu@block[rotate around={39:(\pingu@name-wing-right-start)}]{\pingu@color@right@wing} (\pingu@name-wing-right-start) ellipse [x radius=.22cm, y radius=.935cm] +(90:.22cm and .935cm) coordinate (\pingu@name-wing-right-tip) +(30:.22cm and .935cm) coordinate (\pingu@name-wing-right-cap-up) +(177:.22cm and .935cm) coordinate (\pingu@name-wing-right-cap-down) +(90:.175cm and .775cm) coordinate (\pingu@name-wing-right); \pingu@block{\pingu@color@right@wing} (\pingu@name-wing-right-start)++(-.03mm,4.6mm) to[out=-100,in=-45] (\pingu@name-wing-right-cap-up) -- (\pingu@name-wing-right-start) -- cycle; \pingu@block{\pingu@color@right@wing} (\pingu@name-wing-right-start)++(-.1mm,-4.4mm) to[out=100,in=-50] (\pingu@name-wing-right-cap-down) -- (\pingu@name-wing-right-start) -- cycle; \endscope}{\pingu@wi@above}{-10}{-110} % #endregion % #region wings-raise \@pingu@wings@s{raise}{% \coordinate (\pingu@name-wing-left-start) at ([yshift=-6.25mm]\pingu@name-wings-side-left); \scope[xshift=-\p@] % shift to avoid rounding errors in pdf viewers \pgfinterruptboundingbox \path[/pingu/@invclip] \pingu@path@lowerpingu; \endpgfinterruptboundingbox \pingu@block[rotate around={-17:(\pingu@name-wing-left-start)}]{\pingu@color@left@wing} (\pingu@name-wing-left-start) ellipse [x radius=.195cm, y radius=.925cm] +(90:.195cm and .925cm) coordinate (\pingu@name-wing-left-tip) +(90:.145cm and .775cm) coordinate (\pingu@name-wing-left); \endscope}{% \scope[xshift=\p@] % shift to avoid rounding errors in pdf viewers \pgfinterruptboundingbox \path[/pingu/@invclip] \pingu@path@lowerpingu; \endpgfinterruptboundingbox \coordinate (\pingu@name-wing-right-start) at ([yshift=-6.25mm]\pingu@name-wings-side-right); \pingu@block[rotate around={17:(\pingu@name-wing-right-start)}]{\pingu@color@right@wing} (\pingu@name-wing-right-start) ellipse [x radius=.195cm, y radius=.925cm] +(90:.195cm and .925cm) coordinate (\pingu@name-wing-right-tip) +(90:.145cm and .775cm) coordinate (\pingu@name-wing-right); \endscope}% {\pingu@wi@above}{0}{-126} % #endregion % #region wings-grab \@pingu@wings@s{grab}{% \pingu@layer{foreground}[] \clip[use path=\pingu@lowerpingu]; \coordinate (\pingu@name-wing-left-start) at ([yshift=-4.5mm]\pingu@name-wings-side-left); \pingu@block[rotate around={-42:(\pingu@name-wing-left-start)}]{\pingu@color@left@wing} (\pingu@name-wing-left-start) ellipse [x radius=.225cm, y radius=1.05cm] +(-90:.225cm and 1.05cm) coordinate (\pingu@name-wing-left-tip) +(-90:.175cm and 9mm) coordinate (\pingu@name-wing-left); \endpingu@layer}{% \pingu@layer{foreground}[] \clip[use path=\pingu@lowerpingu]; \coordinate (\pingu@name-wing-right-start) at ([yshift=-4.5mm]\pingu@name-wings-side-right); \pingu@block[rotate around={42:(\pingu@name-wing-right-start)}]{\pingu@color@right@wing} (\pingu@name-wing-right-start) ellipse [x radius=.225cm, y radius=1.05cm] +(-90:.225cm and 1.05cm) coordinate (\pingu@name-wing-right-tip) +(-90:.175cm and 9mm) coordinate (\pingu@name-wing-right); \endpingu@layer}% {\pingu@wi@below}{12}{60} % #endregion % #region wings-shock \@pingu@wings@s{shock}{% \pingu@layer{foreground}[] \clip[use path=\pingu@lowerpingu]; \coordinate (\pingu@name-wing-left-start) at ([yshift=-6.5mm]\pingu@name-wings-side-left); \pingu@block[rotate around={64:(\pingu@name-wing-left-start)}]{\pingu@color@left@wing} (\pingu@name-wing-left-start) ellipse [x radius=.235cm, y radius=.85cm] +(90:.235cm and .85cm) coordinate (\pingu@name-wing-left-tip) +(90:.185cm and .7cm) coordinate (\pingu@name-wing-left); \endpingu@layer}{% \pingu@layer{foreground}[] \clip[use path=\pingu@lowerpingu]; \coordinate (\pingu@name-wing-right-start) at ([yshift=-6.5mm]\pingu@name-wings-side-right); \pingu@block[rotate around={-64:(\pingu@name-wing-right-start)}]{\pingu@color@right@wing} (\pingu@name-wing-right-start) ellipse [x radius=.235cm, y radius=.85cm] +(90:.235cm and .85cm) coordinate (\pingu@name-wing-right-tip) +(90:.185cm and .7cm) coordinate (\pingu@name-wing-right); \endpingu@layer}% {\pingu@wi@below}{-180}{116} % #endregion % #region wings-hug \@pingu@wings@s{hug}{% \coordinate (\pingu@name-wing-left-start) at ([yshift=-6.25mm]\pingu@name-wings-side-left); \scope[xshift=-\p@] % shift to avoid rounding errors in pdf viewers \pgfinterruptboundingbox \path[/pingu/@invclip] \pingu@path@lowerpingu; \endpgfinterruptboundingbox \pingu@block[rotate around={-128:(\pingu@name-wing-left-start)}]{\pingu@color@left@wing} (\pingu@name-wing-left-start) ellipse [x radius=.235cm, y radius=.925cm] +(90:.235cm and .935cm) coordinate (\pingu@name-wing-left-tip) +(175:.235cm and .935cm) coordinate (\pingu@name-wing-left-cap-up) +(22:.235cm and .935cm) coordinate (\pingu@name-wing-left-cap-down) +(90:.175cm and .775cm) coordinate (\pingu@name-wing-left); \pingu@block{\pingu@color@left@wing} (\pingu@name-wing-left-start)++(.03mm,4.6mm) to[out=-80,in=140] (\pingu@name-wing-left-cap-up) -- (\pingu@name-wing-left-start) -- cycle; \pingu@block{\pingu@color@left@wing} (\pingu@name-wing-left-start)++(.085mm,-4.4mm) to[out=82,in=155] (\pingu@name-wing-left-cap-down) -- (\pingu@name-wing-left-start) -- cycle; \endscope}{% \coordinate (\pingu@name-wing-right-start) at ([yshift=-6.25mm]\pingu@name-wings-side-right); \scope[xshift=\p@] % shift to avoid rounding errors in pdf viewers \pgfinterruptboundingbox \path[/pingu/@invclip] \pingu@path@lowerpingu; \endpgfinterruptboundingbox \pingu@block[rotate around={128:(\pingu@name-wing-right-start)}]{\pingu@color@right@wing} (\pingu@name-wing-right-start) ellipse [x radius=.235cm, y radius=.935cm] +(90:.235cm and .935cm) coordinate (\pingu@name-wing-right-tip) +(5:.235cm and .935cm) coordinate (\pingu@name-wing-right-cap-up) +(160:.235cm and .935cm) coordinate (\pingu@name-wing-right-cap-down) +(90:.175cm and .775cm) coordinate (\pingu@name-wing-right); \pingu@block{\pingu@color@right@wing} (\pingu@name-wing-right-start)++(-.03mm,4.6mm) to[out=-100,in=40] (\pingu@name-wing-right-cap-up) -- (\pingu@name-wing-right-start) -- cycle; \pingu@block{\pingu@color@right@wing} (\pingu@name-wing-right-start)++(-.085mm,-4.4mm) to[out=92,in=20] (\pingu@name-wing-right-cap-down) -- (\pingu@name-wing-right-start) -- cycle; \endscope}{\pingu@wi@above}{-30}{-62} \let\@pingu@wings@s\relax % #endregion % #endregion % #region hairstyle \pgfqkeys{/pingu}{hairstyle none/.style={/pingu/hairstyle=none}} \pingu@hairstyle@add{normal}{% \scope\pgfinterruptboundingbox \clip[/pingu/@invclip] (\pingu@name-head-center) ellipse [x radius=\pingu@w@half, y radius=\pingu@head@h@half-.0165mm]; \endpgfinterruptboundingbox \scope[rounded corners=.08mm] \pingu@block{\pingu@color@hair@a} ([yshift=-\pingu@one]\pingu@name-head-top) -- ++(.15mm,0) arc (0:90:\pingu@one@eight{} and .135cm) arc (90:0:.35mm and .75mm); \pingu@block{\pingu@color@hair@b} ([yshift=-\pingu@one]\pingu@name-head-top) -- ++(.33mm,0) arc (0:90:\pingu@one@eight{} and .175cm) arc (90:0:.35mm and \pingu@one); \pingu@block{\pingu@color@hair@c} ([yshift=-\pingu@one]\pingu@name-head-top) -- ++(-.33mm,0) arc (180:90:.17cm and .215cm) arc (90:180:.75mm and .18cm); \pingu@block{\pingu@color@hair@d} ([yshift=-\pingu@one]\pingu@name-head-top) -- ++(.25mm,0) arc (180:90:\pingu@one@eight{} and .175cm) arc (90:180:.35mm and \pingu@one@eight); \pingu@block{\pingu@color@hair@e} ([yshift=-\pingu@one]\pingu@name-head-top) -- ++(.44mm,0) arc (180:90:\pingu@one@eight{} and .135cm) arc (90:180:.35mm and .75mm); \endscope\endscope} % #endregion % #region feet % \long\def\pingu@feet@s#1#2#3{% \@ifnextchar[% {\pingu@feet@s@{#1}{#2}{#3}}% {\pingu@feet@s@{#1}{#2}{#3}[pingu@yellow]}% } \long\def\pingu@feet@s@#1#2#3[#4]{% \pgfqkeys{/pingu}{% left foot #1/.style = {/pingu/left foot={#1}, /pingu/left foot color={##1}},% left foot #1/.default = {#4},% right foot #1/.style = {/pingu/right foot={#1}, /pingu/right foot color={##1}},% right foot #1/.default = {#4},% feet #1/.style = {/pingu/feet={#1}, /pingu/feet color={##1}},% feet #1/.default = {#4}% }% \pingu@leftfoot@add{#1}{#2}\pingu@rightfoot@add{#1}{#3}% } % <@pingu@feet@s> \pgfqkeys{/pingu}{% feet none/.style={/pingu/feet=none}, left foot none/.style={/pingu/left foot=none}, right foot none/.style={/pingu/right foot=none} } % \pingu@feet@s{normal}{% \coordinate (@tmp) at ([xshift=-.5\pingu@foot@single@h]\pingu@name-foot-left); \pingu@block[rotate around={-25+\basicfeetbend:(@tmp)}]{\pingu@color@foot@left} (@tmp) ellipse [ x radius=\pingu@foot@single@w, y radius=\pingu@foot@single@h ]; \pingu@block[rotate around={\basicfeetbend:(\pingu@name-foot-left)}] {\pingu@color@foot@left} (\pingu@name-foot-left) ellipse [ x radius=\pingu@foot@single@w, y radius=\pingu@foot@single@h ]; \coordinate (@tmp) at ([xshift= .5\pingu@foot@single@h]\pingu@name-foot-left); \pingu@block[rotate around={25+\basicfeetbend:(@tmp)}]{\pingu@color@foot@left} (@tmp) ellipse [ x radius=\pingu@foot@single@w, y radius=\pingu@foot@single@h ]; }{% \coordinate (@tmp) at ([xshift=-.5\pingu@foot@single@h]\pingu@name-foot-right); \pingu@block[rotate around={-25-\basicfeetbend:(@tmp)}]{\pingu@color@foot@right} (@tmp) ellipse [ x radius=\pingu@foot@single@w, y radius=\pingu@foot@single@h ]; \pingu@block[rotate around={-\basicfeetbend:(\pingu@name-foot-right)}] {\pingu@color@foot@right} (\pingu@name-foot-right) ellipse [ x radius=\pingu@foot@single@w, y radius=\pingu@foot@single@h ]; \coordinate (@tmp) at ([xshift= .5\pingu@foot@single@h]\pingu@name-foot-right); \pingu@block[rotate around={25-\basicfeetbend:(@tmp)}]{\pingu@color@foot@right} (@tmp) ellipse [ x radius=\pingu@foot@single@w, y radius=\pingu@foot@single@h ]; } % <@feet normal> \pingu@feet@s{sit}{% \pingu@layer{foreground}[] \coordinate (@tmp) at ([xshift=-.35\pingu@foot@single@h,yshift=-.4mm]\pingu@name-foot-left); \pingu@block[rotate around={\basicfeetbend:(@tmp)}]{\pingu@color@foot@left} (@tmp) arc(180:90:1.33mm and 4mm) arc (90:0:1.33mm and .9mm) to[bend left=50] ++(1.33mm,-1.3mm) to[bend left=66] ++(.7mm,-1.8mm) arc(0-50:-90-20:4.13mm and 4.2mm) to[bend left] cycle; \endpingu@layer }{% \pingu@layer{foreground}[xscale=-1] \coordinate (@tmp) at ([xshift=-.35\pingu@foot@single@h,yshift=-.5mm]\pingu@name-foot-right); \pingu@block[rotate around={\basicfeetbend:(@tmp)}]{\pingu@color@foot@right} (@tmp) arc(180:90:1.33mm and 4mm) arc (90:0:1.33mm and .9mm) to[bend left=50] ++(1.33mm,-1.3mm) to[bend left=66] ++(.7mm,-1.8mm) arc(0-50:-90-20:4.13mm and 4.2mm) to[bend left] cycle; \endpingu@layer } % \pingu@feet@s{simple}{% \pingu@block[rotate around={-\basicfeetbend:(\pingu@name-foot-left)}] {\pingu@color@foot@left} (\pingu@name-foot-left) ellipse [ x radius=2.66\pingu@foot@single@w, y radius=\pingu@foot@single@h ]; }{% \pingu@block[rotate around={\basicfeetbend:(\pingu@name-foot-right)}] {\pingu@color@foot@right} (\pingu@name-foot-right) ellipse [ x radius=2.66\pingu@foot@single@w, y radius=\pingu@foot@single@h ]; } % <@feet simple> \pingu@feet@s{back}{% \pingu@block{\pingu@color@foot@left} ([yshift=.2\pingu@foot@single@h]\pingu@name-foot-left) ellipse [x radius=2.5\pingu@foot@single@w,y radius=.435\pingu@foot@single@h]; }{% \pingu@block{\pingu@color@foot@right} ([yshift=.2\pingu@foot@single@h]\pingu@name-foot-right) ellipse [x radius=2.5\pingu@foot@single@w,y radius=.435\pingu@foot@single@h]; } \pingu@feet@s{chubby}{% \pingu@layer{foreground}[rotate around={-\basicfeetbend+45:(\pingu@name-foot-left)}] \pingu@block\pingu@color@foot@left ([xshift=-3mm,yshift=-1.65mm]\pingu@name-foot-left) to[bend right=3] ++(5mm,0) -- ++(.05mm,.6mm) to[out=83,in=129,looseness=1.125] cycle; \ifx\pingu@color@foot@left\@pingu@none\else \colorlet{@}{\pingu@color@foot@left!80!\pingu@color@body@main} \pingu@draw{@} ([xshift=-3mm,yshift=-1.65mm]\pingu@name-foot-left) to[bend right=5] coordinate[pos=.29] (@) coordinate[pos=.69] (@b) ++(5mm,0) -- ++(.05mm,.6mm) to[out=83,in=119,looseness=1.125] cycle; \pingu@draw{@} (@) to[bend right=4] ++(.125mm,.75mm); \pingu@draw{@} (@b) to[bend right=9] ++(.15mm,1.15mm); \fi \endpingu@layer }{% \pingu@layer{foreground}[rotate around={-\basicfeetbend+45:(\pingu@name-foot-right)}] \pingu@block\pingu@color@foot@right ([xshift=3mm,yshift=-1.65mm]\pingu@name-foot-right) to[bend left=3] ++(-5mm,0) -- ++(-.05mm,.6mm) to[out=97,in=76,looseness=1.125] cycle; \ifx\pingu@color@foot@right\@pingu@none\else \colorlet{@}{\pingu@color@foot@right!80!\pingu@color@body@main} \pingu@draw{@} ([xshift=3mm,yshift=-1.65mm]\pingu@name-foot-right) to[bend left=5] coordinate[pos=.29] (@) coordinate[pos=.69] (@b) ++(-5mm,0) -- ++(-.05mm,.475mm) to[out=97,in=81,looseness=1.125] cycle; \pingu@draw{@} (@) to[bend left=4] ++(-.125mm,.75mm); \pingu@draw{@} (@b) to[bend left=9] ++(-.15mm,1.15mm); \fi \endpingu@layer } % #endregion % #region bill % name core | main % \long\def\pingu@bill@s#1#2{% \pgfqkeys{/pingu}{% bill #1/.style = {/pingu/bill={#1}, /pingu/bill color={##1}},% bill #1/.default = pingu@yellow% TODO: defaults }% \pingu@bill@add{#1}{#2}% } \pgfqkeys{/pingu}{bill none/.style={/pingu/bill=none}} % <@pingu@bill@s> % \pingu@bill@s{normal}{% \pingu@block[rounded corners=.1mm]{\pingu@color@bill} (\pingu@name-bill)++(-.19cm,0) arc (180:360:.19cm and .225cm) coordinate[pos=.5] (\pingu@name-bill-bottom) -- ++(-.2mm,.05mm) to[bend right=10] ([xshift=-.17cm,yshift=.05mm]\pingu@name-bill) -- cycle; } % <@bill normal> \pingu@bill@s{foreground}{% \pingu@layer{foreground}[] \pingu@block{\pingu@color@bill} [rounded corners=.1mm] (\pingu@name-bill)++(-.19cm,0) arc (180:360:.19cm and .225cm) coordinate[pos=.5] (\pingu@name-bill-bottom) -- ++(-.2mm,.05mm) to[bend right=10] ([xshift=-.17cm,yshift=.05mm]\pingu@name-bill)--cycle; \endpingu@layer } % \pingu@bill@s{flat}{% \pingu@block{\pingu@color@bill} (\pingu@name-bill)++(-.19cm,0) arc (180:360:.19cm and .225cm) coordinate[pos=.5] (\pingu@name-bill-bottom) -- cycle; } % <@bill flat> % #endregion % #endregion % #region dots \def\@pingu@draw@dots{% \pingu@layer{foreground}[] % mark wing outer \path[draw,pink,thick] (\pingu@name-wing-left-start-low) --(\pingu@name-wing-left-start) -- (\pingu@name-wing-left) -- (\pingu@name-wing-left-low); \path[draw,pink,thick] (\pingu@name-wing-right-start-low) -- (\pingu@name-wing-right-start) -- (\pingu@name-wing-right) -- (\pingu@name-wing-right-low); \@for\@pingu@elem:={belly-center,head,head-top,foot-left,foot-right,eye-right,eye-left,bill,bill-bottom,wings-side-left,wings-side-right,wing-left-start,wing-left-tip,wing-right-start,wing-right-tip,head-right,head-left,head-center,head-back-con-left,head-back-con-right,bottom-center,waist-left,waist-right}\do{ \path[fill=green] (\pingu@name-\@pingu@elem) circle[radius=1.125\p@]; } \@for\@pingu@elem:={wing-left,wing-right,wing-left-low,wing-right-low,wing-left-up,wing-right-up,wing-left-start-low,wing-right-start-low,wing-left-start-up,wing-right-start-up}\do{ \path[fill=yellow] (\pingu@name-\@pingu@elem) circle[radius=1.125\p@]; } % mark wing items \csname @pingu@wingitem@\@pingu@select@leftwing@ @\endcsname \colorlet{@wmark}{magenta} \else \colorlet{@wmark}{teal} \fi \pingu@block[/pingu/@draw=@wmark,thick,rotate around={\csname @pingu@wingangle@items@\@pingu@select@leftwing@ @\endcsname:(\pingu@name-wing-left)}]{@wmark} (\pingu@name-wing-left)++(0,3mm) circle [radius=\pingu@one] -- ++(0,-6mm); \csname @pingu@wingitem@\@pingu@select@rightwing@ @\endcsname \colorlet{@wmark}{magenta} \else \colorlet{@wmark}{teal} \fi \pingu@block[/pingu/@draw=@wmark,thick,rotate around={-\csname @pingu@wingangle@items@\@pingu@select@rightwing@ @\endcsname:(\pingu@name-wing-right)}]{@wmark} (\pingu@name-wing-right)++(0,3mm) circle [radius=\pingu@one] -- ++(0,-6mm); \endpingu@layer} % endregion % #region extras % #region extras below \def\pingu@@xif@eb#1#2{\csname if@pingu@x@#1@\endcsname\csname pingu@draw@eb@#2\endcsname\fi} \def\pingu@xif@eb#1#2{\ifcsname if@pingu@x@#1@\endcsname{\pingu@@xif@eb{#1}{#2}}\fi} \def\pingu@draw@extras@below{% \pingu@xif@eb{heart}{heart}% \pingu@xif@eb{devilwings}{devilwings}% \pingu@xif@eb{glow}{glow}% \pingu@xif@eb{belt}{belt}% \pingu@xif@eb{tie}{tie}% \pingu@xif@eb{pants}{pants}% \pingu@xif@eb{medal}{medal}% \pingu@xif@eb{bowtie}{bowtie}% \pingu@xif@eb{cup}{cup}% \pingu@xif@eb{vampireteeth}{vampireteeth}% \pingu@xif@eb{blush}{blush}% \pingu@xif@eb{eyepatchleft}{eyepatch@l}% \pingu@xif@eb{eyepatchright}{eyepatch@r}% \pingu@xif@eb{monocleleft}{monocle@l}% \pingu@xif@eb{monocleright}{monocle@r}% \pingu@xif@eb{horseon}{horseon}% } % #region cup \pingu@create@extra{cup}{% cup/.code = {\pingu@set@extra{cup}{true}\pingu@color{cup}{#1}}, cup/.default = pingu@green, cup steam/.code = \pingu@color{cup@steam}{#1},% cup steam/.default = lightgray!90!orange,% cup steam shift/.code = \def\pingu@x@cup@steam@shift{#1},% cup straw/.code = \pingu@color{cup@straw}{#1}% }{cup straw=\pingu@color@cup,cup steam=\@pingu@none,cup steam shift=0mm} \def\pingu@draw@eb@cup{% \pingu@block[rounded corners=.25mm]{\pingu@color@cup} (\pingu@name-belly-center)++(-.325cm,.275cm) to[bend right=2] ++(.5mm,-.675cm) to[bend right=8] ++(.55cm,\z@) to[bend right=2] ++(.5mm,.675cm); \path (\pingu@name-belly-center)++(0,.275cm) -- (\pingu@name-bill) coordinate[pos=.5,xshift=-2mm] (\pingu@name-cup-straw-outer-angle); \path (\pingu@name-belly-center)++(-.115cm,.275cm) coordinate (\pingu@name-straw-outer-start); \pingu@block[rounded corners=.15mm]{\pingu@color@cup@straw} (\pingu@name-straw-outer-start) -- (\pingu@name-cup-straw-outer-angle) -- (\pingu@name-bill) -- ++(.5mm,0) -- ([xshift=.5mm]\pingu@name-cup-straw-outer-angle) -- ([xshift=.5mm]\pingu@name-straw-outer-start) -- cycle; \pingu@block{\pingu@color@cup} (\pingu@name-belly-center)++(0,.275cm) ellipse [x radius=.325cm,y radius=.5mm]; % TODO: configure opacity \pgfonlayer{foreground} \pingu@block[rounded corners=.05mm,opacity=.55]{\pingu@color@cup@steam} (\pingu@name-belly-center)++(1.5mm+\pingu@x@cup@steam@shift,4mm) coordinate(@) to[out=100,in=260] ++(.3mm,3.75mm) -- ++(0.1mm,0) to[out=280,in=80] ([xshift=.1mm]@) -- cycle; \pingu@block[rounded corners=.05mm,opacity=.55]{\pingu@color@cup@steam} (\pingu@name-belly-center)++(0mm+\pingu@x@cup@steam@shift,3.33mm) coordinate(@) to[out=100,in=260] ++(.2mm,2.75mm) -- ++(0.1mm,0) to[out=280,in=80] ([xshift=.1mm]@) -- cycle; \pingu@block[rounded corners=.05mm,opacity=.55]{\pingu@color@cup@steam} (\pingu@name-belly-center)++(-1.25mm++\pingu@x@cup@steam@shift,3.65mm) coordinate(@) to[out=100,in=260] ++(.3mm,3.75mm) -- ++(0.1mm,0) to[out=280,in=80] ([xshift=.1mm]@) -- cycle; \endpgfonlayer } % #endregion % #region eye patch % #region eye patch left \pingu@create@extra{eyepatchleft}{% eyepatch left/.forward to = /pingu/eye patch left, eye-patch left/.forward to = /pingu/eye patch left, eye patch left/.code = \pingu@set@extra{eyepatchleft}{true}\pingu@color{eyepatchleft}{#1}, eye patch left/.default = \pingu@color@body@main, }{} \newlength\pingu@patchw \pingu@patchw=6.5pt \def\pingu@draw@eb@eyepatch@l{% \pingu@draw[line width=1.25pt,line cap=round]{\pingu@color@eyepatchleft} (\pingu@name-head-right)++(-2.75mm,-2.5mm) to[bend right=10] coordinate[pos=.71] (\pingu@name-eye-left-patch) ([xshift=-.85mm,yshift=1.25mm]\pingu@name-wings-side-left); \pingu@block[rotate around={-9:(\pingu@name-eye-left-patch)}]{\pingu@color@eyepatchleft} (\pingu@name-eye-left-patch)++(0,.5pt) ellipse [x radius=\pingu@patchw, y radius=.65pt]; \pingu@block[rotate around={-9:(\pingu@name-eye-left-patch)}]{\pingu@color@eyepatchleft} (\pingu@name-eye-left-patch) ++(-\pingu@patchw,.5pt) arc(180:360:\pingu@patchw{} and 8.9pt); } % #endregion % #region eye patch right \pingu@create@extra{eyepatchright}{% eyepatch right/.forward to = /pingu/eye patch right, eye-patch right/.forward to = /pingu/eye patch right, eye patch right/.code = \pingu@set@extra{eyepatchright}{true}\pingu@color{eyepatchright}{#1}, eye patch right/.default = \pingu@color@body@main, }{} \def\pingu@draw@eb@eyepatch@r{% \pingu@draw[line width=1.25pt,line cap=round]{\pingu@color@eyepatchright} (\pingu@name-head-left)++(2.75mm,-2.5mm) to[bend left=10] coordinate[pos=.71] (\pingu@name-eye-right-patch) ([xshift=.85mm,yshift=1.25mm]\pingu@name-wings-side-right); \pingu@block[rotate around={9:(\pingu@name-eye-right-patch)}]{\pingu@color@eyepatchright} (\pingu@name-eye-right-patch)++(0,.5pt) ellipse [x radius=\pingu@patchw, y radius=.65pt]; \pingu@block[rotate around={9:(\pingu@name-eye-right-patch)}]{\pingu@color@eyepatchright} (\pingu@name-eye-right-patch) ++(-\pingu@patchw,.5pt) arc(180:360:\pingu@patchw{} and 8.9pt); } % #endregion % #endregion % #region glow \pingu@create@extra{glow}{% glow/.code = \pingu@set@extra{glow}{true}\pingu@color{glow}{#1}, glow/.default = pingu@white, glow thick/.style = {/pingu/glow={#1}, /pingu/glow width function={3.5mm-1.25*\i mm}}, glow steps/.code = \def\pingu@x@extra@glow@steps{#1}, glow function/.code = \def\pingu@x@extra@glow@func{#1}, glow width function/.code = \def\pingu@x@extra@glow@width@func{#1}, glow solid/.style = {/pingu/glow={#1},/pingu/glow function={1},/pingu/glow steps={1.2,1.3}} }{glow steps={1,1.1,1.2,1.3,1.4,1.5},glow function={.1/\i},glow width function={2.85mm-1.65*\i mm}} \def\pingu@draw@eb@glow{% \pingu@layer{background}[] \@for\i:={\pingu@x@extra@glow@steps}\do{ \scope[/pingu/@block/.append style={draw=\pingu@color@glow,line width=\pingu@x@extra@glow@width@func},/pingu/@draw/.append style={draw=\pingu@color@glow,line width=\pingu@x@extra@glow@width@func},opacity=\pingu@x@extra@glow@func,transparency group] \pingu@draw{\pingu@color@glow} \pingu@path@lowerpingu; % todo: disable re set of coordinates % only draw, if not ofset \csname @pingu@wingitem@\@pingu@select@leftwing@ @\endcsname\@pingu@drawer@leftwing@\fi \csname @pingu@wingitem@\@pingu@select@rightwing@ @\endcsname\@pingu@drawer@rightwing@\fi \endscope } \endpingu@layer } % #endregion % #endregion % #region extras above % NOTE: No auto append to allow easy order change \def\pingu@@xif@ea#1#2{\csname if@pingu@x@#1@\endcsname\csname pingu@draw@ea@#2\endcsname\fi} \def\pingu@xif@ea#1#2{\ifcsname if@pingu@x@#1@\endcsname{\pingu@@xif@ea{#1}{#2}}\fi} \def\pingu@draw@extras@above{% \pingu@xif@ea{cap}{cap}% \pingu@xif@ea{eyeframe}{eyeframe}% \pingu@xif@ea{mask}{mask}% \pingu@xif@ea{glasses}{glasses}% \pingu@xif@ea{glassesround}{glassesround}% \pingu@xif@ea{devilhorns}{devilhorns}% \pingu@xif@ea{headband}{headband}% \pingu@xif@ea{strawhat}{strawhat}% \pingu@xif@ea{hat}{hat}% \pingu@xif@ea{mitra}{mitra}% \pingu@xif@ea{witchhat}{witchhat}% \pingu@xif@ea{constructionhelmet}{constructionhelmet}% \pingu@xif@ea{conicalhat}{conicalhat}% \pingu@xif@ea{crown}{crown}% \pingu@xif@ea{cakehat}{cakehat}% \pingu@xif@ea{pumpkinhat}{pumpkinhat}% \pingu@xif@ea{jackolantern}{jackolantern}% \pingu@xif@ea{princesscrown}{princesscrown}% \pingu@xif@ea{rook}{rook}% \pingu@xif@ea{halo}{halo}% \pingu@xif@ea{vrheadset}{vrheadset}% \pingu@xif@ea{headphone}{headphone}% \pingu@xif@ea{sheriffstar}{sheriffstar}% \pingu@xif@ea{santahat}{santahat}% \pingu@xif@ea{woolhat}{woolhat}% \pingu@xif@ea{deerhat}{deerhat}% \pingu@xif@ea{santabeard}{santabeard}% \pingu@xif@ea{banner}{banner}% \pingu@xif@ea{bee}{bee}% } % #region halo \newif\if@pingu@x@halo@glow \newif\if@pingu@x@halo@above \pingu@create@extra{halo}{% halo/.code = \pingu@set@extra{halo}{true}\pingu@color{halo}{#1}, halo/.default = pingu@lightblue, halo raise/.code = \def\pingu@x@halo@raise{#1}, halo above/.is if = @pingu@x@halo@above, halo glow/.is if = @pingu@x@halo@glow% only active if glows loaded }{halo glow=\ifpengu@setup@glows@ true\else false\fi,halo raise=0mm,halo above=false} \def\pingu@draw@ea@halo{% \if@pingu@x@halo@above\pingu@layer{foreground}[]\fi \pingu@block[even odd rule]{\pingu@color@halo} ([yshift=\pingu@x@halo@raise]\pingu@name-head-top) ellipse [x radius=\pingu@w@half-\pingu@one,y radius=2.5mm] ellipse [x radius=\pingu@w@half-1.95mm,y radius=1.55mm]; \if@pingu@x@halo@glow \pingu@block[even odd rule,/pingu/@glow]{\pingu@color@halo} ([yshift=\pingu@x@halo@raise]\pingu@name-head-top) ellipse [x radius=(\pingu@w@half-1.95mm)*1.7,y radius=1.55mm*2.35] ellipse [x radius=\pingu@w@half-1.95mm,y radius=1.55mm]; \fi \if@pingu@x@halo@above\endpingu@layer{foreground}\fi } % #endregion % #region eye frame \pingu@create@extra{eyeframe}{% % extra halo eyeframe/.forward to = /pingu/eye frame, eye-frame/.forward to = /pingu/eye frame, eye frame/.code = \pingu@set@extra{eyeframe}{true}\pingu@color{eyeframe}{#1}, eye frame/.default = pingu@black, }{} \def\pingu@draw@ea@eyeframe{% \pingu@draw{\pingu@color@eyeframe} [rounded corners=.25mm](\pingu@name-eye-left)++(-2mm,1.5mm) to[bend left=8] ++(4.2mm,0) to[out=-80,in=70] ++(-.2mm,-2.75mm) to[bend left=32.5] ++(-3.65mm,0mm) to[out=135,in=-90] ++(-.8mm,2.7mm) -- cycle; \pingu@draw{\pingu@color@eyeframe} [rounded corners=.25mm](\pingu@name-eye-right)++(2mm,1.5mm) to[bend right=8] ++(-4.2mm,0) to[out=-100,in=110] ++(.2mm,-2.75mm) to[bend right=32.5] ++(3.65mm,0mm) to[out=45,in=-90] ++(.8mm,2.7mm) -- cycle; } % #endregion % #region sheriff star \pingu@create@extra{sheriffstar}{% sheriff star/.code = \pingu@set@extra{sheriffstar}{true}\pingu@color{sheriffstar}{#1}, sheriff star/.default = pingu@yellow, sheriff star content/.code = \def\pingu@x@sheriff@star@content{#1}, sheriff star lines/.code = \pingu@color{sheriffstar@lines}{#1}, }{sheriff star content={\resizebox{2.25mm}!{\textsf{\bfseries Sheriff}}},sheriff star lines=pingu@black!92!\pingu@color@sheriffstar} \def\pingu@draw@ea@sheriffstar{% \pingu@layer{middle}[] \path (\pingu@name-belly-center) -- (\pingu@name-head-back-con-left) node[pos=.6, star, star points=7, fill=\pingu@color@sheriffstar,minimum size=1.75mm,scale=.9,rotate=-5] (@) {}; \foreach \i in {1,...,7} { \pingu@block{\pingu@color@sheriffstar!98!pingu@black} (@.outer point \i) circle [radius=.2mm]; } \node[outer sep=0pt,inner xsep=0pt,inner ysep=.25mm] (@s) at (@) {\ifx\pingu@color@sheriffstar@lines\@pingu@none\else\color{\pingu@color@sheriffstar@lines}\fi\pingu@x@sheriff@star@content}; \pingu@draw[line width=.002mm]{\pingu@color@sheriffstar@lines} (@s.north east) -- (@s.north west); \pingu@draw[line width=.002mm]{\pingu@color@sheriffstar@lines} (@s.south east) -- (@s.south west); \endpingu@layer} % #endregion % #endregion % #endregion % #region wingitems % #region wingitems-setup \def\pingu@may@draw@wing#1#2{\csname if@pingu@x@#1#2@\endcsname \csname pingu@draw@wi@#1\endcsname{#2}\fi} \edef\pingu@str@wing@left{left} \let\@pingu@wingitems@\@empty \newif\if@pingu@wing@item@side@left@ \def\pingu@setup@wing#1#2{% \edef\@tmpa{#2}% minus on left \ifx\pingu@str@wing@left\@tmpa \expandafter\def\expandafter\@angle{\csname @pingu@wingangle@items@\csname @pingu@select@#2wing@\endcsname @\endcsname+\pingu@wing@left@item@angle@user}% \def\@sidesign{1}% \if@pingu@wi@flip@left \@pingu@wing@item@side@left@false \else \@pingu@wing@item@side@left@true\fi \else \expandafter\def\expandafter\@angle{-(\csname @pingu@wingangle@items@\csname @pingu@select@#2wing@\endcsname @\endcsname+\pingu@wing@right@item@angle@user)}% \def\@sidesign{-1}% \if@pingu@wi@flip@right \@pingu@wing@item@side@left@true \else \@pingu@wing@item@side@left@false\fi \fi \expandafter\def\expandafter\@col{\csname pingu@color@#1#2\endcsname}% } \def\pingu@draw@wing@items{% \pingu@layer{middle}[]\@pingu@draw@wing@items@left\endpingu@layer \pingu@layer{middle}[]\@pingu@draw@wing@items@right\endpingu@layer } \let\@pingu@draw@wing@items@left\@empty \let\@pingu@draw@wing@items@right\@empty \def\pingu@create@wing@extra#1#2#3{% \pingu@csappto{@pingu@wingitems@}{#1}% \expandafter\def\expandafter\@pingu@draw@wing@items@left\expandafter{\@pingu@draw@wing@items@left\pingu@may@draw@wing{#1}{left}}% \expandafter\def\expandafter\@pingu@draw@wing@items@right\expandafter{\@pingu@draw@wing@items@right\pingu@may@draw@wing{#1}{right}}% \def\@lr{left}% \protected@edef\@tmp{\expandafter\expandafter\expandafter\expandafter\expandafter\unexpanded{{#1left}{#2}{#3}}}% \expandafter\pingu@create@extra\@tmp \def\@lr{right}% \protected@edef\@tmp{\expandafter\expandafter\expandafter\expandafter\expandafter\unexpanded{{#1right}{#2}{#3}}}% \expandafter\pingu@create@extra\@tmp} % #endregion % #region cane \pingu@create@wing@extra{cane}{% cane \@lr/.code = {\pingu@set@extra{cane\@lr}{true}\pingu@color{cane\@lr}{##1}}, cane \@lr/.default = pingu@bronze, cane \@lr\space raise/.code = {\@namedef{pinug@x@cane@raise@\@lr}{##1}}, cane \@lr\space length/.code = {\@namedef{pinug@x@cane@length@\@lr}{##1}}, }{cane \@lr\space raise=0mm,cane \@lr\space length=15mm} % #1 wing \def\pingu@draw@wi@cane#1{% \pingu@setup@wing{cane}{#1}% \if@pingu@wing@item@side@left@ \pingu@block[thick,rotate around={\@angle+5:(\pingu@name-wing-#1)}]{\@col}(\pingu@name-wing-#1)++(0,-7mm+\pinug@x@cane@raise@left) -- ++(0,\csname pinug@x@cane@length@#1\endcsname) arc(180:0:2.25mm and 2.2mm) arc(360:180:.3mm and .275mm) arc(0:180:1.65mm and 1.65mm) -- ++(0,-\csname pinug@x@cane@length@#1\endcsname) arc(360:180:.3mm and .275mm) -- cycle; \else \pingu@block[thick,rotate around={\@angle-5:(\pingu@name-wing-#1)}]{\@col}(\pingu@name-wing-#1)++(0,-7mm+\pinug@x@cane@raise@right) -- ++(0,\csname pinug@x@cane@length@#1\endcsname) arc(0:180:2.25mm and 2.2mm) arc(180:360:.3mm and .275mm) arc(180:0:1.65mm and 1.65mm) -- ++(0,-\csname pinug@x@cane@length@#1\endcsname) arc(180:360:.3mm and .275mm) -- cycle; \fi } % #endregion % #region staff \pingu@create@wing@extra{staff}{% staff \@lr/.code = {\pingu@set@extra{staff\@lr}{true}\pingu@color{staff\@lr}{##1}}, staff \@lr/.default = pingu@bronze, staff \@lr\space length/.code = \expandafter\def\csname pingu@staff@\@lr @length\endcsname{##1}, staff \@lr\space raise/.code = \expandafter\def\csname pingu@staff@\@lr @raise\endcsname{##1}, staff \@lr\space code app/.code = \expandafter\appto\csname pingu@staff@\@lr @code\endcsname{##1}, staff \@lr\space code pre/.code = \expandafter\preto\csname pingu@staff@\@lr @code\endcsname{##1}, staff \@lr\space code/.code = \expandafter\def\csname pingu@staff@\@lr @code\endcsname{##1}, spear \@lr/.style = {staff \@lr, staff \@lr\space code app={ \noexpand\pgfonlayer{background} \fill[##1,rounded corners=1pt] ([yshift=-1.5mm]\noexpand\pingu@name-staff-\@lr-top) -- ++(1mm,1.5mm) -- ++(-1mm,4mm) -- ++(-1mm,-4mm) -- cycle; \noexpand\endpgfonlayer }}, spear \@lr/.default=gray, cross \@lr/.style = {staff \@lr=##1, staff \@lr\space code app={ \noexpand\pgfonlayer{foreground} \fill[##1,rounded corners=1pt] ([yshift=-4.5mm,xshift=-4mm]\noexpand\pingu@name-staff-\@lr-top) rectangle ++(8mm,1mm); \noexpand\endpgfonlayer }}, cross \@lr/.default=pingu@bronze }{staff \@lr\space length=28mm,staff \@lr\space raise=-11mm,staff \@lr\space code={}} \def\pingu@draw@wi@staff#1{% \pingu@setup@wing{staff}{#1}% \scope[rotate around={\@angle:(\pingu@name-wing-#1)}] \pingu@block{\csname pingu@color@staff#1\endcsname}(\pingu@name-wing-#1)++(\@sidesign*-.2mm,\csname pingu@staff@#1@raise\endcsname) -- ++(0,\csname pingu@staff@#1@length\endcsname) arc(180:0:\@sidesign*.4mm and .3mm) coordinate[pos=.5] (\pingu@name-staff-#1-top) -- ++(0,-\csname pingu@staff@#1@length\endcsname) arc(360:180:\@sidesign*.4mm and .3mm) -- cycle; \csname pingu@staff@#1@code\endcsname \endscope } % #endregion % #endregion % #region clothes \def\pingu@@xif@cloth#1#2{\csname if@pingu@x@#1@\endcsname\csname pingu@draw@cloth@#2\endcsname\fi} \def\pingu@xif@cloth#1#2{\ifcsname if@pingu@x@#1@\endcsname{\pingu@@xif@cloth{#1}{#2}}\fi} \def\pingu@draw@clothing@behind{% \pingu@xif@cloth{secondshirt}{secondshirt@behind}% \pingu@xif@cloth{shirt}{shirt@behind}% \pingu@xif@cloth{cloak}{cloak@behind}% } \def\pingu@draw@clothing@middle{% \pingu@xif@cloth{secondshirt}{secondshirt@middle}% \pingu@xif@cloth{shirt}{shirt@middle}% \pingu@xif@cloth{cloak}{cloak@middle}% } \def\pingu@draw@clothing@main{% \pingu@xif@cloth{secondshirt}{secondshirt}% \pingu@xif@cloth{shirt}{shirt}% \pingu@xif@cloth{cloak}{cloak}% } % #endregion \def\pingu@@dummy@lib#1#2{% \pgfqkeys{/pingu}{#1/.code={\PackageError{\tikzpingus@filename}{To use '#1' you need to load the '#2' library via '\string\pinguloadlibrary{#2}'}}}% \expandafter\def\csname pingu@@lib@#1@\endcsname{#2}% } \def\pingu@@dummy@selector#1#2#3{% \expandafter\csname pingu@#3@add\endcsname{#1}{\PackageError{\tikzpingus@filename}{To use '#1' with '#3' you need to load the '#2' library via '\string\pinguloadlibrary{#2}'}}% \expandafter\def\csname pingu@@lib@#1@#3@\endcsname{#2}% } \def\pingu@dummy@lib#1#2{\edef\tmp@list{#2}\@for\@current:=\tmp@list\do{\expandafter\pingu@@dummy@lib\expandafter{\@current}{#1}}\xappto\pingu@defaultlibs{,{#1}/{#2}}\xappto\pingu@@defaultlibs{,#1}}% % library | selector | keys \def\pingu@dummy@selector#1#2#3{\edef\tmp@list{#3}\@for\@current:=\tmp@list\do{\expandafter\pingu@@dummy@selector\expandafter{\@current}{#1}{#2}}} \def\pingu@defaultlibs{}\def\pingu@@defaultlibs{} \providecommand\pingulibpathprefix{} \def\pingu@load@library#1{% % store common catcodes \expandafter\edef\csname pingu@lib@#1@atcode\endcsname{\the\catcode`\@}% \expandafter\edef\csname pingu@lib@#1@barcode\endcsname{\the\catcode`\|}% \expandafter\edef\csname pingu@lib@#1@dollarcode\endcsname{\the\catcode`\$}% \catcode`\@=11 \catcode`\|=12 \catcode`\$=3\relax \def\pingu@tmp{\pingulibpathprefix tikzpingus-#1.lib.tex}\relax \InputIfFileExists{\pingu@tmp}{}{\PackageError{\tikzpingus@filename}{There is no '#1' library (searched: '\pingu@tmp')}} % restore catcodes \catcode`\@=\csname pingu@lib@#1@atcode\endcsname \catcode`\|=\csname pingu@lib@#1@barcode\endcsname \catcode`\$=\csname pingu@lib@#1@dollarcode\endcsname } \def\pingu@loadlibrary#1{% \ifcsname pingu@lib@#1@loaded\endcsname\else% do not load again \expandafter\let\csname pingu@lib@#1@loaded\endcsname=\@empty \pingu@load@library{#1}\relax \fi } \def\pinguloadlibrary#1{\edef\tmp@list{#1}\@for\tmp@elem:=\tmp@list\do{\ifx\tmp@elem\@empty\else\pingu@loadlibrary{\tmp@elem}\fi}} \let\pinguloadlibraries\pinguloadlibrary \pingu@dummy@lib{shirts}{shirt,second shirt} \pingu@dummy@lib{glasses}{glasses,glasses round,monocle left,monocle right} \pingu@dummy@lib{medieval}{rook,crown,princess crown} \pingu@dummy@lib{cloak}{cloak,cape} \pingu@dummy@lib{christmas}{santa hat,santa beard,wool hat,deer hat,present left, present right,snowball left, snowball right} \pingu@dummy@lib{science-fiction}{lightsaber left,lightsaber right} \pingu@dummy@lib{fun}{cake-hat,pumpkin-hat,lollipop left,lollipop right,vampire teeth,broom left,broom right,jack o lantern,jack o lantern helmet,hammer left, hammer right,plank left, plank right,magnifier left, magnifier right} \pingu@dummy@lib{technology}{vr-headset,headphone,vr-controller left,vr-controller right,laptop left,laptop right} \pingu@dummy@lib{flags}{flag left,flag right} \pingu@dummy@lib{hats}{strawhat,hat,cap,construction helmet,conical hat,witch hat,mitra} \pingu@dummy@lib{sport}{head band,medal} \pingu@dummy@lib{formal}{tie,bow tie,pants,belt} \pingu@dummy@lib{signs}{sign post left,sign post right} \pingu@dummy@lib{devil}{devil horns,devil wings,devil fork left,devil fork right,eyes devil,left eye devil,right eye devil} \pingu@dummy@selector{devil}{lefteye}{devil} \pingu@dummy@selector{devil}{righteye}{devil} \pingu@dummy@lib{safe}{mask} \pingu@dummy@lib{magic}{hand cast left,hand cast right} \pingu@dummy@lib{movement}{}% register the lib \pingu@dummy@selector{movement}{bodytype}{tilt-right,tilt-left} \pingu@dummy@lib{emotions}{eyes sad,left eye sad,right eye sad,eyes angry,left eye angry,right eye angry,eyes hearts,left eye heart,right eye hearts,bill angry,blush,eyes critical,left eye critical,right eye critical} \pingu@dummy@selector{emotions}{lefteye}{sad,angry,hearts} \pingu@dummy@selector{emotions}{righteye}{sad,angry,hearts} \pingu@dummy@lib{horse}{horse left,horse right,on horse,horse behind} \pingu@dummy@lib{bee}{bee} \ifpengu@setup@bare@\else \pinguloadlibraries{\pingu@@defaultlibs} \fi \endinput