      SUBROUTINE VCHAR(X,Y,A,N,ICODE,SIZE,THETA,XOFF,YOFF)
C
C  CHAR IS USER PLOT SYSTEM ENTRY FOR PRINTING
C  CHARACTERS.  SINCE USAGE IS COMPLEX REFER TO USER
C  DOCUMENTATION FOR DETAILS.
C
C  SUBROUTINES AND FUNCTION SUBPROGRAMS UNIQUELY REQUIRED
C  BY CHAR..
C    PXZ03,PXZ04
C
      DIMENSION X(1),Y(1),A(1)
      INTEGER A
C
$INCLUDE:'pxz99.cmn'
C
C
      INTEGER PXZ00,PXZ04,PXZ08
      DIMENSION XC(25),YC(25),IPEN(25)
C
      DATA LMASK/-256/
C
C  CHECK INPUT PARAMETERS..
      IF (PXZ00(-1).NE.0) RETURN
      IF (SIZE.GT.0.) GO TO 10
      KER=12
      GO TO 310
   10 IF (N.GT.0) GO TO 20
      KER=13
      GO TO 310
   20 CALL GETCOL(ICODE,JCODE)
      IF (0.LE.JCODE.AND.JCODE.LE.7) GO TO 30
      KER=14
      GO TO 310
C
C  PARAMETERS CHECKED.
C
C  START SET UP..
   30 XPMX=XRSPP+.5
      YPMX=YRSPP+.5
      ICD=IAND(JCODE,3)
      IF (JCODE.GT.3) GO TO 40
      ITAL=0
      GO TO 50
   40 ITAL=256
   50 IF (ICD-1) 90,60,120
   60 IF (IAND(A(1),LMASK).EQ.0) GO TO 70
      ICHR=PXZ04(A,1)+ITAL
      GO TO 80
   70 ICHR=A(1)+ITAL
   80 IF (ICHR.NE.ICHRL)
     1  CALL PXZ03(XC,YC,IPEN,NXYC,ICHR,ICHRL)
      IF (ICHR.LE.0) GO TO 300
      ICHRL=ICHR
      ILJ=1
      GO TO 110
   90 IF (IAND(A(1),LMASK).EQ.0) GO TO 100
      ILJ=0
      GO TO 110
  100 ILJ=-1
  110 NXYI=N
      NC=1
      GO TO 130
C
  120 NC=N
      NXYI=1
      ILJ=0
      IF (ICD.EQ.2) GO TO 130
      IDTA=1
      GO TO 140
  130 IDTA=0
C
C  SET SCALING AND OFFSETS.
  140 ICNT=1
      NCHRI=NCHRI+NXYI
      IF (THETA.EQ.0.) GO TO 150
      CS=COS(THETA)
      SS=SIN(THETA)
C
C  SCALING DONE IN TERMS OF X RASTERS/UNIT
C  RATIO TAKEN AFTER  ROTATION, ETC..
  150 SIZC=XRASP*SIZE
      XYCS=SIZC*.1666667
      XV=.5*SIZC
      XFFR=XOFF*XRASP-XV
      YFFR=YOFF*XRASP-XV
C
C  X-Y LOOP
      DO 290 I=1,NXYI
        IF (IDTA) 160,170,160
  160   FXR=X(1)*XRASP
        FYR=Y(1)*YRASP
        GO TO 180
  170   IF (PXZ08(X(I),FXR,1)+PXZ08(Y(I),FYR,2).NE.0)  GO TO 280
        IF (FXR.LT.RXMIN.OR.FXR.GT.RXMAX.OR.
     1     FYR.LT.RYMIN.OR.FYR.GT.RYMAX) GO TO 280
C
C  CHARACTER LOOP
  180   NCHRO=NCHRO+1
        DO 270 J=1,NC
          IF (ILJ) 190,200,220
  190     ICHR=A(ICNT)+ITAL
          GO TO 210
  200     ICHR=PXZ04(A(ICNT),J)+ITAL
  210     IF (ICHR.NE.ICHRL)
     1      CALL PXZ03(XC,YC,IPEN,NXYC,ICHR,ICHRL)
          IF (ICHR.LE.0) GO TO 260
          ICHRL=ICHR
C
C  CHARACTER VECTOR TRANSFORMATION LOOP
  220     DO 250 K=1,NXYC
            XV=XFFR+XC(K)*XYCS
            YV=YFFR+YC(K)*XYCS
            IF (THETA.EQ.0.) GO TO 230
            T=XV*CS-YV*SS+FXR
            YV=(XV*SS+YV*CS)*RXYRS+FYR
            XV=T
            GO TO 240
  230       XV=XV+FXR
            YV=YV*RXYRS+FYR
  240       IF (XV.LE.-.5.OR.YV.LE.-.5) GO TO 260
            IF (XV.GE.XPMX.OR.YV.GE.YPMX) GO TO 260
            CALL PXZ07(XV,YV,IPEN(K))
  250       CONTINUE
C
C  END OF CHARACTER TRNAFORMATION LOOP
  260     IF (J.LT.NC) XFFR=XFFR+SIZC
C
  270     CONTINUE
C
C  END OF CHARACTER LOOP
  280   IF (ICD.EQ.1) ICNT=ICNT+1
  290   CONTINUE
C
C  END OF X-Y LOOP.
C
C  CLEAN UP AND QUIT.
  300 IX=PXZ00(0)
      RETURN
C
  310 CALL PXZ02(KER)
      RETURN
C
      END


