%begin
%integer index, i, j
%integer %array junk(1:128)
%routine read font(%string(255) file); ! Read in (one) font description
  %integer char,num,i,n,min,max,height,width,maxwidth,minwidth


  openinput(1,file.".fnt")
  openoutput(1,file."p.fnt")
  select input(1)
  select output(1)
  read(min); read(max)
  write(min, 0); space
  write(max, 0); space
  new line
  %for char=min,1,max %cycle
    readsymbol(num) %until num=':';  !Ignore character name
    write(char, 3)
    print string(" :")
    read(num)
    read(width)
    read(junk(i)) %for i = 1, 1, num
    j = 0
    %while j<=32 %cycle
       i = 1
       i = i+1 %while i<=num %and 1&junk(i)=0
       %if i>num %start
          junk(i) = junk(i)>>1 %for i = 1, 1, num
       %else
          %exit
       %finish
       j = j+1
    %repeat
    %while j<=32 %cycle
       i = 1
       i = i+1 %while i<=num %and 16_80000000>>j&junk(i)=0
       %if i>num %start
          j = j+1
       %else
          %exit
       %finish
    %repeat
    num = num-1 %while num>0 %and junk(num)=0
    write(num, 2)
    %if num=0 %start
       write(width, 2)
    %else
       write(32-j+1, 2)
    %finish
    space
    %for i = 1, 1, num %cycle
       write(junk(i), 0)
       space
    %repeat
    newline
  %repeat
  closeinput; selectinput(0)
%end
readfont(cliparam)
%end %of %program
