\raggedbottom \nopagenumbers
\hsize=17.4cm \hoffset=1.5cm
\vsize=27.4cm \voffset=1.5cm
\parfillskip=0pt \rightskip=0pt plus3em \lineskip=-.4pt

\def\udelej#1#2#3#4{\message{#1,#2,#3,#4}%
   % \stvary: BOK, \sbarva: CZM, \spocet: 123, \splnost: FSE
   \def\stvary{#1}\def\sbarva{#2}\def\spocet{#3}\def\splnost{#4}%
   \hbox{\vrule\vbox to8.7cm{% 
      \hrule\vss \tmpnum=0 
      \loop \kreslitvar \advance\tmpnum by1 
         \ifnum\tmpnum<\spocet\relax \kern63bp \repeat 
      \vss\hrule}\vrule}\penalty0\kern-.4pt}

\def\kreslitvar{\hbox to5.7cm{\kern.5cm\csname tvar\stvary\endcsname\hss}}

\def\barvaC{1 0 0 RG 1 0 0 rg }
\def\barvaZ{0 1 0 RG 0 1 0 rg }
\def\barvaM{0 0 1 RG 0 0 1 rg }

\def\tvarK{\pdfliteral{q
   \csname barva\sbarva\endcsname 
   .9 0 0 .9 0 0 cm
    4 w 0 0 m  75 30 l 150 0 l 75 -30 l h
   \if\splnost F f \else \if\splnost S W \fi S \fi
   \if\splnost S 3.5 w \srafa \fi Q
}}
\def\tvarO{\pdfliteral{q
   \csname barva\sbarva\endcsname 
   .9 0 0 .9 0 0 cm
   4 w 0 0 m
   0 15 15 30 30 30 c 120 30 l 135 30 150 15 150 0 c
   150 -15 135 -30 120 -30 c 30 -30 l 15 -30 0 -15 0 0 c h 
   \if\splnost F f \else \if\splnost S W \fi S \fi 
   \if\splnost S 3.5 w \srafa \fi Q
}}
\def\srafa{\fornum1..15\do{1 0 0 1 10 0 cm 0 -30 m 0 80 l S }}

\def\tvarB{\pdfliteral{q
   \csname barva\sbarva\endcsname 
   1 0 0 1 0 -39 cm
   4 w
   96.871 65.438 m 75.754 66.52 71.961 61.105 53.277 59.48 c 40.555
   58.371 26.203 61.105 17.539 74.371 c -11.434 58.668 6.465 14.137 35.68 12.637 
   c 56.801 11.555 60.59 16.969 79.273 18.594 c 91.996 19.699 106.348 
   16.969 115.012 3.703 c 143.984 19.406 126.086 63.938 96.871 65.438 c h 
   \if\splnost F f \else \if\splnost S W \fi S \fi 
   \if\splnost S 3.5 w \srafa \fi Q
}}

\noindent 
\foreach BOK\do{\foreach CZM\do{\foreach 123\do{\foreach FSE\do{%
   \udelej{#1}{##1}{####1}{########1}%
}}}}

\end


