%%%%%%%%%%%%%%%%%% ifwea.gen %%%%%%%%%%%%%%%%%%%%%%%
% (c) Ingo Kloeckl
% This program can be redistributed and/or modified under the terms
% of the LaTeX Project Public License Distributed from CTAN
% archives in directory macros/latex/base/lppl.txt; either
% version 1 of the License, or any later version.

% History
% 20.12.1999 v1.0  IK 
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% weather symbols
% by I.Kloeckl, ingo.kloeckl@2k-software.de

pen normalpen;
normalpen := pencircle scaled .75linewidth;

%
% centers of wind symbol
%
"BlueSky";
beginchar(0,4pt#,4pt#,0);
  pickup normalpen;
  draw fullcircle scaled 4pt shifted (2pt,2pt);
endchar;

"BlueSky3/4";
beginchar(1,4pt#,4pt#,0);
  pickup normalpen;
  draw fullcircle scaled 4pt shifted (2pt,2pt);
  fill quartercircle scaled 4pt shifted(2pt,2pt)--(2pt,2pt)--cycle;
endchar;

"BlueSky2/4";
beginchar(2,4pt#,4pt#,0);
  pickup normalpen;
  draw fullcircle scaled 4pt shifted (2pt,2pt);
  fill halfcircle scaled 4pt shifted (2pt,2pt)--(2pt,2pt)--cycle;
endchar;

"BlueSky1/4";
beginchar(3,4pt#,4pt#,0);
  pickup normalpen;
  draw fullcircle scaled 4pt shifted (2pt,2pt);
  fill halfcircle scaled 4pt rotated 180 shifted(2pt,2pt)--(2pt,2pt)--cycle;
  fill quartercircle scaled 4pt rotated -90 shifted(2pt,2pt)--(2pt,2pt)--cycle;
endchar;

"CloudySky";
beginchar(4,4pt#,4pt#,0);
  pickup normalpen;
  fill fullcircle scaled 4pt shifted (2pt,2pt);
endchar;

%
%  nice thermometers
%
def Thermo(expr n, height) =
  beginchar((char n),3pt#,10pt#,0); 
  pickup pencircle scaled .5linewidth;
  fill fullcircle scaled 3pt shifted (1.5pt,1.5pt);

  pickup pencircle scaled .2linewidth;
  draw (0.5pt,2pt)--(0.5pt,9pt)..(1.5pt,10pt)..(2.5pt,9pt)--(2.5pt,2pt)--cycle;
  draw (1.5pt,2pt)--(1.5pt,9pt);
  path p; p := (1pt,1pt)--(2pt,1pt);
  for i=2 upto 8:
    draw p shifted(0, i*1pt);
  endfor;

  fill (1.2pt,2pt)--(1.2pt,height*1pt)--(1.8pt,height*1pt)--(1.8pt,2pt)--cycle;
endchar;
enddef;

"Thermoa";      Thermo(5,3);
"Thermob";      Thermo(6,4);
"Thermoc";      Thermo(7,5);
"Thermod";      Thermo(8,6);
"Thermoe";      Thermo(9,7);
"Thermof";      Thermo(10,8);
"Thermog";      Thermo(11,9);

%
%  popular weather symbols
%
"Sun";
beginchar(16,10pt#,10pt#,0);
  pickup normalpen;
  draw fullcircle scaled 5pt shifted (5pt,5pt);
  path p;
  p=(7.5pt,5pt)--(10pt,5pt);
  for i=0 upto 7:
    draw p rotatedaround ((5pt,5pt),(i*45));
  endfor;
endchar;

"Halfsun";
beginchar(17,10pt#,10pt#,0);
  pickup normalpen;
  draw fullcircle scaled 5pt shifted (5pt,5pt);
  fill halfcircle--cycle scaled 5pt rotated (180) shifted (5pt,5pt);
  path p;
  p=(7.5pt,5pt)--(10pt,5pt);
  for i=0 upto 4:
    draw p rotatedaround ((5pt,5pt),(i*45));
  endfor;
endchar;

"Nosun";
beginchar(18,10pt#,10pt#,0);
  pickup normalpen;
  fill fullcircle scaled 7pt shifted (5pt,5pt);
endchar;

"Fog";
beginchar(19,10pt#,10pt#,0);
pickup pencircle scaled 0.5linewidth;
  for i=.1h step .1h until .9h: 
    for j=0 step .3w until .7w:
      draw (j,i)--(j+.2w,i);
    endfor
  endfor
endchar;


"ThinFog";
beginchar(20,10pt#,10pt#,0);
pickup pencircle scaled .25linewidth;
  for i=.1h step .1h until .9h: 
    for j=0 step .3w until .7w:
      draw (j,i)--(j+.2w,i);
    endfor
  endfor
endchar;

"Rain";
beginchar(21,10pt#,10pt#,0);
pickup normalpen;
for i=1 step 2 until 7:
  draw (i*1pt,1pt)--((i+2)*1pt,4pt); draw((i+1)*1pt,5pt)--((i+3)*1pt,8pt);
endfor;
endchar;

"WeakRain";
beginchar(22,10pt#,10pt#,0);
pickup pencircle scaled .5linewidth;
for i:=1 step 2 until 7:
  draw (i*1pt,1pt)--((i+1)*1pt,2pt); 
  draw((i+1)*1pt,4pt)--((i+2)*1pt,5pt);
  draw((i+2)*1pt,7pt)--((i+3)*1pt,8pt);
endfor;
endchar;

"Hagel";
beginchar(23,10pt#,10pt#,0);
pickup pencircle scaled 4linewidth;
drawdot(3pt,3pt); drawdot(1pt,8pt); drawdot(6pt,7pt);
drawdot(1pt,1pt); drawdot(8pt,2pt); drawdot(3pt,6pt);
drawdot(7pt,3pt); drawdot(3pt,8pt); drawdot(6pt,1pt);
endchar;

"Graupel";
beginchar(24,10pt#,10pt#,0);
pickup pencircle scaled 2linewidth;
drawdot(3pt,3pt); drawdot(1pt,8pt); drawdot(6pt,7pt);
drawdot(1pt,1pt); drawdot(8pt,2pt); drawdot(3pt,6pt);
drawdot(7pt,3pt); drawdot(3pt,8pt); drawdot(6pt,1pt);
endchar;

"Snow";
beginchar(25,10pt#,10pt#,0);
  pickup normalpen;
  path p[];
  p1 = (0,0)--(4pt,0);
  p2 = (4pt,-1pt)--(3pt,0)--(4pt,1pt);
  for i:=0 upto 5:
    draw p1 rotated (i*60) shifted(5pt,5pt);
    draw p2 shifted(-2pt,0) rotated (i*60) shifted(5pt,5pt);
    draw p2 shifted(-1pt,0) rotated (i*60) shifted(5pt,5pt);
    draw p2 rotated (i*60) shifted(5pt,5pt);
  endfor;
endchar;

"Blitz";
beginchar(26,10pt#,10pt#,0);
  pickup normalpen;
  fill (6.4pt,10pt)--(8.7pt,8.4pt)--(5.6pt,4.1pt)--(4.4pt,4.9pt)--(2.4pt,2.1pt)--
       (3.9pt,1.6pt)--(0,0)--(1.1pt,4pt)--(1.6pt,2.4pt)--(3.5pt,8.5pt)--
       (5pt,6pt)--cycle;
endchar;

path cloud;
cloud = (5.0pt,0.0pt){left}..{up}(0.0pt,3.2pt){up}..{right}(2.1pt,5.7pt){right}..
	{dir -60}(4.0pt,4.2pt){dir 40}..{dir -40}(5.5pt,4.1pt){dir -40}..
	{dir -80}(6.1pt,2.4pt){dir 60}..{right}(7.8pt,3.3pt){right}..
	{down}(9.3pt,2.0pt){down}..{left}cycle;

"Cloud";
beginchar(27,10pt#,6pt#,0);
  pickup normalpen;
  draw cloud;
endchar;

"RainCloud";
beginchar(28,10pt#,10pt#,0);
  pickup normalpen;
  draw cloud shifted(0, 4pt);
  for i=0 step 3 until 6:
    draw (i*1pt,1pt)--((i+1)*1pt,4pt);
    draw ((i+1)*1pt,0)--((i+2)*1pt,3pt);
  endfor;
endchar;

"WeakRainCloud";
beginchar(29,10pt#,6pt#,0);
  pickup normalpen;
  draw cloud shifted(0, 4pt);
  for i=0 step 3 until 6:
    draw (i*1pt,1pt)--((i+1)*1pt,4pt);
  endfor;
endchar;

"SunCloud";
beginchar(30,10pt#,10pt#,0);
  pickup normalpen;
  draw fullcircle scaled 4pt shifted (6pt,5pt);
  path p;
  p=(8pt,5pt)--(10pt,5pt);
  for i=0 upto 7:
    draw p rotatedaround ((6pt,5pt),(i*45));
  endfor;
  unfill cloud; draw cloud;
endchar;

"SnowCloud";
beginchar(31,10pt#,10pt#,0);
  pickup normalpen;
  draw cloud shifted(0, 4pt);
  pickup pencircle scaled 2linewidth;
  drawdot(3pt,3pt); drawdot(6pt,2pt); drawdot(2pt,3pt);
  drawdot(1pt,0); drawdot(8pt,1pt); drawdot(9pt,3pt);
  drawdot(7pt,3pt); drawdot(4pt,0); drawdot(5pt,2pt);
endchar;

"FilledCloud";
beginchar(32,10pt#,6pt#,0);
  pickup normalpen;
  fill cloud;
endchar;

"FilledRainCloud";
beginchar(33,10pt#,10pt#,0);
  pickup normalpen;
  fill cloud shifted(0, 4pt);
  for i=0 step 3 until 6:
    draw (i*1pt,1pt)--((i+1)*1pt,4pt);
    draw ((i+1)*1pt,0)--((i+2)*1pt,3pt);
  endfor;
endchar;

"FilledWeakRainCloud";
beginchar(34,10pt#,6pt#,0);
  pickup normalpen;
  fill cloud shifted(0, 4pt);
  for i=0 step 3 until 6:
    draw (i*1pt,1pt)--((i+1)*1pt,4pt);
  endfor;
endchar;

"FilledSunCloud";
beginchar(35,10pt#,10pt#,0);
  pickup normalpen;
  draw fullcircle scaled 4pt shifted (6pt,5pt);
  path p;
  p=(8pt,5pt)--(10pt,5pt);
  for i=0 upto 7:
    draw p rotatedaround ((6pt,5pt),(i*45));
  endfor;
  fill cloud;
endchar;

"FilledSnowCloud";
beginchar(36,10pt#,10pt#,0);
  pickup normalpen;
  fill cloud shifted(0, 4pt);
  pickup pencircle scaled 2linewidth;
  drawdot(3pt,3pt); drawdot(6pt,2pt); drawdot(2pt,3pt);
  drawdot(1pt,0); drawdot(8pt,1pt); drawdot(9pt,3pt);
  drawdot(7pt,3pt); drawdot(4pt,0); drawdot(5pt,2pt);
endchar;

%HalfWeakRainCloud 165
%CloudBlitz 166

def wind(expr n, strength) =
  beginchar((char n),0pt#,11pt#,0); 
  pickup normalpen;
  draw (0,4pt)--(0,10pt);
  for k=0 upto strength/2:
    draw (0,(10-k)*1pt)--(-2pt,(11-k)*1pt);
  endfor
  if (strength mod 2 = 1):
    draw (0,(9.5-strength/2)*1pt)--(-1pt,(10-strength/2)*1pt);
  fi
endchar;
enddef;

for j=0 step 1 until 10:
  wind(48+j,j);
endfor;

end.
%%%%%%%%%%%%%%%%%% end of ifwea.gen %%%%%%%%%%%%%%%%%%%%%%%
