PACKETlaserjetplotDEFINESdrawingarea,beginplot,endplot,plotend,stdhoehe,stdbreite,clear,pen,move,zeichensatz,draw,plotterkanal:LETesc="�",reset="�E",graphicsresolution="�*t75R",formfeed="�",landscape="�&I1O",horpixel=800,verpixel=560,intsperscanline=50,horfaktor=29.52756,vertfaktor=29.52756,bit14=16384,namederbitmap="Plotter",nameofspooltask="PRINTER",datenraumtypfuerbitmap=1055;BOUND ROWverpixelROWintsperscanlineINT VARbitmap;INT VARxpos,ypos,xfak,yfak,plotterchannel,groesstexkoord,groessteykoord,ausgewaehlt,nextpointnr,linienraster,linientyp;REAL VARbuchstabenhoehe:=0.76,buchstabenbreite:=0.3375,faktor;BOOL VARloeschstift,characterdefined:=FALSE;LET ZEICHENSATZ=STRUCT(ROW255TEXTchar,INTwidth,height);ROW3ZEICHENSATZ VARzeichen;PROCdrawingarea(REAL VARxcm,ycm,INT VARxpixel,ypixel):xcm:=27.0;ycm:=19.0;xpixel:=horpixel-1;ypixel:=verpixel-1;END PROCdrawingarea;REAL PROCstdhoehe:buchstabenhoeheEND PROCstdhoehe;REAL PROCstdbreite:buchstabenbreiteEND PROCstdbreite;PROCstdhoehe(REAL CONSThoehe):buchstabenhoehe:=hoeheEND PROCstdhoehe;PROCstdbreite(REAL CONSTbreite):buchstabenbreite:=breiteEND PROCstdbreite;PROCbeginplot:xpos:=0;ypos:=0;pen(0,1,0,1)ENDPROCbeginplot;PROCendplot:ENDPROCendplot;PROCplotend:INT VARspaltenbeginn:=(groesstexkoordDIV16)+1,zeilenbeginn:=groessteykoord+1;TEXT VARdoppelbyte:="xx";druckerkanalankoppeln;bereitedruckeraufgrafikausgabevor;gibdiebitmapaus;druckedieseite;gibdruckerkanalfrei.druckerkanalankoppeln:spoolcontrolpassword("");waitforhalt(/nameofspooltask);continue(plotterchannel).gibdruckerkanalfrei:break(quiet);spoolcontrolpassword("");startspool(/nameofspooltask).bereitedruckeraufgrafikausgabevor:out(reset);out(landscape);out(graphicsresolution);out("�*r1A").gibdiebitmapaus:INT VARzeilenzaehler;FORzeilenzaehlerFROMzeilenbeginnDOWNTO1REPbefehlssequenzschickenPER.befehlssequenzschicken:out(esc+"*b"+text(neueanzahlderbytes)+"W");gibteilzeileaus.neueanzahlderbytes:(spaltenbeginnDIV8)+1.gibteilzeileaus:INT VARspaltenzaehler;FORspaltenzaehlerFROM1UPTOneueanzahlderbytesDIV2REPreplace(doppelbyte,1,bitmap(zeilenzaehler)(spaltenzaehler));out(doppelbyte)PER.druckedieseite:out("�*rB");out("�E").END PROCplotend;PROCclear:richtebitmapein;loeschebitmap;beginplot.richtebitmapein:IFexists(namederbitmap)THENforget(namederbitmap,quiet)FI;bitmap:=new(namederbitmap);type(old(namederbitmap),datenraumtypfuerbitmap).loeschebitmap:INT VARi,j;FORiFROM1UPTOverpixelREP FORjFROM1UPTOintsperscanlineREPbitmap(i)(j):=0PER PER.END PROCclear;PROCpen(INT CONSTbackground,foreground,thickness,linetype):linientyp:=linetype;linienraster:=neueslinienraster;nextpointnr:=0;loeschstift:=foreground=0.neueslinienraster:SELECTlinientypOF CASE2:1365CASE3:975CASE4:255CASE5:639OTHERWISE0END SELECT.END PROCpen;PROCmove(INT CONSTx,y):xpos:=x;ypos:=yEND PROCmove;PROCdraw(INT CONSTgoalx,goaly):ueberpruefeaktuellekoordinatenmitbishergroessten;IFlinientyp<>0THENzeichnelinieFI;xpos:=goalx;ypos:=goaly;ueberpruefeaktuellekoordinatenmitbishergroessten;korrigierenextpointnr.ueberpruefeaktuellekoordinatenmitbishergroessten:IFxpos>groesstexkoordTHENgroesstexkoord:=xposFI;IFypos>groessteykoordTHENgroessteykoord:=yposFI.zeichnelinie:bereitezeichnenvor;verteilegeradeundschraegeschrittemoeglichstgleichmaessig.bereitezeichnenvor:INT VARdx:=goalx-xpos,dy:=goaly-ypos,xdir:=sign(dx),ydir:=sign(dy),xsteps:=abs(dx),ysteps:=abs(dy),totalsteps,biassteps,horstep,verstep;IFxsteps>ystepsTHENtotalsteps:=xsteps;biassteps:=ysteps;horstep:=xdir;verstep:=0ELSEtotalsteps:=ysteps;biassteps:=xsteps;horstep:=0;verstep:=ydirFI.verteilegeradeundschraegeschrittemoeglichstgleichmaessig:INT VARs:=totalstepsDIV2,x:=xpos,y:=ypos;INT VARi;FORiFROM0UPTOtotalstepsREPzeichneaktuellenpunktderlinie;sINCRbiassteps;IFs0ANDcharacterdefinedTHENdrawgraphiccharacterFI.drawgraphiccharacter:INT CONSTxstep:=characterxstep,ystep:=characterystep;INT VARxposition:=xpos,yposition:=ypos,i,n,x,y;BOOL VARmoveorder;FORiFROM1UPTOlength(record)REPdrawcharacteriPER;move(xpos,ypos).characterxstep:REAL VARrundungsfehler:=0.0;IFwidth<>0.0THENrundungsfehler:=frac(cosd(angle)*horfaktor*width);int(cosd(angle)*horfaktor*width)ELSEint(cosd(angle)*real(zeichen(ausgewaehlt).width))FI.characterystep:IFheight<>0.0THENint(sind(angle)*vertfaktor*height)ELSEint(sind(angle)*real(zeichen(ausgewaehlt).height))FI.setcharacterheightandwidth:IFwidth=0.0ANDheight=0.0THENxfak:=zeichen(2).width;yfak:=zeichen(2).heightELSExfak:=int(horfaktor*width);yfak:=int(vertfaktor*height)FI.zeichensatzauswaehlen:beurteilenutzenderzeichensaetze;IFqualitaet(1)0CANDyfakDIV(n*matrixhoehe)>0REPqualitaet(i):=(xfak-n*matrixbreite)+(yfak-n*matrixhoehe);nINCR1PER;matrixfaktor(i):=real(n-1);IFn=1THENmatrixfaktor(i):=verkleinerungsfaktorFI PER.verkleinerungsfaktor:IF(matrixbreite-xfak)>(matrixhoehe-yfak)THENreal(xfak)/real(matrixbreite)ELSEreal(yfak)/real(matrixhoehe)FI.freizeilen:SELECTiOF CASE1:0CASE2:0CASE3:1OTHERWISE0END SELECT.drawcharacteri:TEXT CONSTchar:=zeichen(ausgewaehlt).char[code(recordSUBi)];FORnFROM1UPTOlength(char)DIV4REPvalue(char,n,x,y,moveorder);IFmoveorderTHENmove(xposition+x,yposition+y)ELSEdraw(xposition+x,yposition+y)FI PER;diffINCRrundungsfehler;xpositionINCRxstep;IFdiff>1.0THENxpositionINCR1;diffDECR1.0FI;ypositionINCRystep.END PROCdraw;PROCdraw(TEXT CONSTrecord):draw(record,0.0,0.0,0.0)END PROCdraw;PROCvalue(TEXT CONSTchar,INT CONSTn,INT VARx,y,BOOL VARmove):x:=charISUBn+n-1;y:=charISUBn+n;IFx<0THEN IF(xANDbit14)<>0THENmove:=FALSE ELSEmove:=TRUE;x:=xXORbit14FI ELSE IF(xANDbit14)<>0THENmove:=TRUE;x:=xXORbit14ELSEmove:=FALSE FI FI;x:=int(real(x)*faktor);y:=int(real(y)*faktor)END PROCvalue;PROCplotpixel(INT CONSTx,y):IFgueltigerpunktTHEN IFloeschstiftTHENunplot(x,y)ELSEplot(x,y)FI FI.gueltigerpunkt:x