%begin %integer index, i, j %integer %array font(0:4999) %half %integer %array junk(1:12) %external %routine %spec gen %alias "FRED_GRAPHICS_GENSYM" %c (%integer ch, %half %integer %name st) %routine read font(%string(255) file); ! Read in (one) font description %integer char,num,i,n,min,max,height=0 font(i) = 512 %for i=0,1,255; !Default: null character font(i) = 0 %for i=262, 1, 4999 font(256) = 12; font(257) = 0; font(258) = 8; font(259) = 0 font(260) = 0; font(261) = 0; !This is the null character index = 262; !This is where the rest starts %for char=0,1,255 %cycle font(char)=index<<1 num = 12 height = num %if num>height; !Note highest character font(index+1) = 8 junk(i) = 0 %for i=1, 1, 12 gen(char, junk(1)) %if 0<=char<=5 %or 12<=char<=15 %or char=19 %start j = 8 %else j = 0 %while j<=16 %cycle i = 1 i = i+1 %while i<=12 %and 16_8000&junk(i)=0 %if i>12 %start junk(i) = junk(i)<<1 %for i = 1, 1, 12 %else %exit %finish j = j+1 %repeat %while j<=16 %cycle i = 1 i = i+1 %while i<=12 %and (1<12 %start j = j+1 %else %exit %finish %repeat %finish num = num-1 %while num>0 %and junk(num)=0 i = 1 i = i+1 %while i<=num %and junk(i)=0 font(index+1) = 16-j+1 %unless j=8 %or num=0 font(index) = num-i+1 index = index+3 font(index-1) = i-1 %while i<=num %cycle font(index) = junk(i) i = i+1 index = index+1 %repeat %repeat index = index-1 closeinput; selectinput(0) %end %routine print byte(%integer b) b = b&16_FF print symbol(b) %end %routine print word(%integer w) print byte(w>>8) print byte(w) %end %routine print long(%integer l) print word(l>>16) print word(l) %end %string(255) f f = cliparam readfont(f.".fnt") openoutput(1,f.".bft") select output(1) %for i = 0, 1, index %cycle print word(font(i)) %repeat %end %of %program