%! lualatex znaky-karet.tex

\documentclass[a4paper]{article}
\usepackage[x11names]{xcolor}
\usepackage{tikz}
\pagestyle{empty}
\parindent=0pt
\usepackage{luaotfload}

\ifx
\paperwidth=4.0cm
\paperheight=\paperwidth
\pdfpagewidth=\paperwidth
\pdfpageheight=\paperwidth
\fi

% BBO, týmáky
\definecolor{ns}{HTML}{7ba5ce}
\definecolor{ew}{HTML}{8473c6}

% Barvy dle vzoru Debian Tenace
\definecolor{spades}{HTML}{0159ee} % 0000b3
\definecolor{hearts}{HTML}{ee0101} % e60000
\definecolor{diamonds}{HTML}{ee8901} %ee4c00
\definecolor{clubs}{HTML}{019210} % 004c00

\begin{document}
\centering

% Definice pro všechny tvary
\def\pomerx{0.4cm}
\def\pomery{1cm}

% Definované styly
\def\barvy{
\begin{tikzpicture}
  [
  line width=0.02*\pomery,
  %
  piky1/.style={fill=spades,draw=black},
  herce1/.style={fill=hearts,draw=black},
  kule1/.style={fill=diamonds,draw=black},
  krize1/.style={fill=clubs,draw=black},
  %
  piky2/.style={fill=spades,draw=spades},
  herce2/.style={fill=hearts,draw=hearts},
  kule2/.style={fill=diamonds,draw=diamonds},
  krize2/.style={fill=clubs,draw=clubs},
  %
  piky3/.style={fill=none,draw=black},
  herce3/.style={fill=none,draw=black},
  kule3/.style={fill=none,draw=black},
  krize3/.style={fill=none,draw=black},
  %
  piky4/.style={fill=black,draw=black},
  herce4/.style={fill=none,line width=0.04*\pomery,draw=black},
  kule4/.style={fill=none,line width=0.04*\pomery,draw=black},
  krize4/.style={fill=black,draw=black},
  %
  piky5/.style={fill=black,draw=black},
  herce5/.style={fill=black,draw=black},
  kule5/.style={fill=black,draw=black},
  krize5/.style={fill=black,draw=black},
  ]

% srdce alias herce
%\ifx
\draw[herce\varianta, line join=round, xshift=1cm] (0,0) 
  to [out=90,in=-100] (-\pomerx,0.8*\pomery) 
  to [out=80,in=180] (-0.5*\pomerx,\pomery) 
  to [out=0,in=90] (0,0.7*\pomery) 
  to [out=90,in=180] (0.5*\pomerx,\pomery) 
  to [out=0,in=100] (\pomerx,0.8*\pomery)
  to [out=-80,in=90] (0,0)%; a zpět nahoru
  to [out=90,in=-100] (-\pomerx,0.8*\pomery) 
  to [out=80,in=180] (-0.5*\pomerx,\pomery);
%\fi

% kára alias kule
\begin{scope}[xshift=2cm]
\draw[kule\varianta] (0,0) 
  to [out=110,in=-40] (-\pomerx,0.5*\pomery) 
  to [out=40,in=-120] (0,\pomery) 
  to [out=-60,in=140] (\pomerx,0.5*\pomery) 
  to [out=220,in=70] (0,0);
\draw[kule\varianta] (\pomerx,0.5*\pomery)
  to [out=220,in=70] (0,0)
  to [out=110,in=-40] (-\pomerx,0.5*\pomery) ;
\end{scope}

% piky
\begin{scope}[xshift=0cm]
% stopka
\draw[piky\varianta,rounded corners=.02pt] 
  (0,0.02*\pomery) to [out=180,in=0] (-0.5*\pomerx,0)--(-0.5*\pomerx,0.02*\pomery)
  to [out=0,in=-90] (-0.05*\pomerx,0.4*\pomery)
  --(0,0.45*\pomery)
  --(0.05*\pomerx,0.4*\pomery)
  to [out=-90,in=180] (0.5*\pomerx,0.02*\pomery)
  --(0.5*\pomerx,0) to [out=180,in=0] (0,0.02*\pomery);
% hlavička
\draw[piky\varianta, line join=round] 
  (-0.05*\pomerx,0.4*\pomery)
  to [out=240,in=0] (-0.5*\pomerx,0.3*\pomery)
  to [out=180,in=-90] (-\pomerx,0.5*\pomery)
  to [out=90,in=-90] (0,\pomery)
  to [out=-90,in=90] (\pomerx,0.5*\pomery)
  to [out=-90,in=0] (0.5*\pomerx,0.3*\pomery)
  to [out=180,in=-60] (0.05*\pomerx,0.4*\pomery)
-- (0,0.45*\pomery)  
-- (-0.05*\pomerx,0.4*\pomery)
  to [out=240,in=0] (-0.5*\pomerx,0.3*\pomery);
\end{scope}

% trefy alias kříže
\begin{scope}[xshift=3cm]
\draw[krize\varianta,rounded corners=.02pt] 
  (0,0.02*\pomery) to [out=180,in=0] (-0.5*\pomerx,0)--(-0.5*\pomerx,0.02*\pomery)
  to [out=0,in=-90] (-0.05*\pomerx,0.4*\pomery)
  --(0,0.5*\pomery)--(0.05*\pomerx,0.4*\pomery)
  to [out=-90,in=180] (0.5*\pomerx,0.02*\pomery)
  --(0.5*\pomerx,0) to [out=180,in=0] (0,0.02*\pomery);
\foreach \x in {0,110,-110} {
\draw[krize\varianta,rotate around={\x:(0,0.5*\pomery)}] 
  (0,0.5*\pomery)
  to [out=180-35,in=-80] (-0.51*\pomerx,0.75*\pomery)
  to [out=90,in=180] (0,\pomery)
  to [out=0,in=90] (0.51*\pomerx,0.75*\pomery)
  to [out=-100,in=0+35] (0,0.5*\pomery);
  } % \foreach
\end{scope}
\end{tikzpicture}
\par\medskip % přechod na další řádek
} % barvy

%\ifx
\def\varianta{1}
\barvy
\def\varianta{2}
\barvy
\def\varianta{3}
\barvy
\def\varianta{4}
\barvy
\def\varianta{5}
\barvy
%\fi
%\end{document}


%\newpage
% implicitní značky
\def\znackasever{N}
\def\znackajih{S}
\def\znackavychod{E}
\def\znackazapad{W}

\def\mstul{%
\begin{tikzpicture}[
  %remember picture, overlay,
  inner sep=1pt, outer sep=0pt,
  ]
\node[rectangle,minimum width=11mm,minimum height=11mm,draw,line width=0.75pt] (stul) 
  %at (current page.center) 
  {};
\draw[fill=ns,draw=none] (stul.south east)--(stul.north west)--(stul.north east)--(stul.south west)--cycle;
\draw[fill=ew,draw=none] (stul.south east)--(stul.north west)--(stul.south west)--(stul.north east)--cycle;
\draw (stul.north east)--(stul.south west)
  (stul.north west)--(stul.south east);
\node[anchor=north] at (stul.north) {\znackasever};
\node[anchor=east] at (stul.east) {\znackavychod};
\node[anchor=west] at (stul.west) {\znackazapad};
\node[anchor=south] at (stul.south) {\znackajih};
\end{tikzpicture}}
%end of \mstul

\mstul
%
\definecolor{ns}{gray}{0.4}
\definecolor{ew}{gray}{1}
\mstul
%
\colorlet{ns}{yellow}
\colorlet{ew}{green}
\mstul
\medskip

\def\znackasever{S}
\def\znackajih{J}
\def\znackavychod{V}
\def\znackazapad{Z}
\colorlet{ns}{cyan}
\colorlet{ew}{magenta}
\mstul
%
\colorlet{ns}{blue}
\colorlet{ew}{red}
\mstul
%
\colorlet{ns}{orange}
\colorlet{ew}{brown}
\mstul
\medskip

% ruština
\font\mfont={file:MingLiU} at 10pt%
\def\znackasever{\mfont с}%
\def\znackajih{\mfont ю}%
\def\znackavychod{\mfont в}%
\def\znackazapad{\mfont з}%
\colorlet{ns}{DarkOliveGreen1!50}%
\colorlet{ew}{DarkOliveGreen3!50}%
\mstul
% japonština
\font\mfont={file:MingLiU} at 10pt%
\def\znackasever{\mfont北}%
\def\znackajih{\mfont南}%
\def\znackavychod{\mfont東}%
\def\znackazapad{\mfont西}%
\colorlet{ns}{DarkOliveGreen1!75}
\colorlet{ew}{DarkOliveGreen3!75}
\mstul
% korejština
\font\mfont={file:Batang} at 10pt
\def\znackasever{\mfont북}%
\def\znackajih{\mfont남}%
\def\znackavychod{\mfont동}%
\def\znackazapad{\mfont서}%
\colorlet{ns}{DarkOliveGreen1}
\colorlet{ew}{DarkOliveGreen3}
\mstul

\end{document}



