    	SUBROUTINE IFTEXT( NCHS, TEXT, IR, ARRAY )
C
C  PROGRAMMER:  R.S. ZHOU
C		ALFRED UNIVERSITY	JAN-1986
C
C	THIS ROUTINE HANDLES THE GRAPHTEXT PLOTTING.
C
C	NCHS -------- NUMBER OF CHARACTERS IN "TEXT".
C	TEXT -------- TEXTSTRING TO BE PLOTTED IN CHARACTER FORMAT.
C	IR ---------- LENGTH OF THE "ARRAY"
C	ARRAY(1) ---- STARTING POSITION (X) OF "TEXT".
C	ARRAY(2) ---- STARTING POSITION (Y) OF "TEXT"
C	ARRAY(3) ---- WIDTH OF "TEXT" IN INCHES.
C	ARRAY(4) ---- HEIGHT OF "TEXT" IN INCHES.
C	ARRAY(5) ---- ROTATION ANGLE OF "TEXT" IN DEGREES.
C
    	INCLUDE 'HP7221.CBS'
    	CHARACTER	TEXT(1)*1
     	LOGICAL		BOLDFACE
     	DIMENSION	ARRAY(1)

     	IF( NCHS.EQ.0 ) RETURN
     	NCH = IABS(NCHS)
C
C  SET THE CHARACTER SIZE...
C
     	IF( IR.GT.3 ) THEN
     	    IF( IPL.GT.NBS-7 ) CALL IFINIT_DUMP
     	    IPB(IPL+1) = '~'
     	    IPB(IPL+2) = '%'
     	    IPL = IPL + 2
    	    CALL IFINIT_MBP( INT(FUNI*ARRAY(3)*XSCL),
     +                       2*INT(FUNI*ARRAY(4)*YSCL) )
     	ENDIF
C
C  SET STRING ROTATION...
C
     	IF( IR.GT.4 ) THEN
    	    ANGLE = AMOD( ARRAY(5)+XANG, 360.0 )
    	    IF( ANGLE.LT.0.0 ) ANGLE = 360.0 + ANGLE
    	    IF( ANGLE.NE.0.0 ) THEN
     		IF( IPL.GT.NBS-4 ) CALL IFINIT_DUMP
     		IPL = IPL + 1
     		IPB(IPL) = 'w'
     		CALL IFINIT_MBA(ANGLE)
     	    ENDIF
     	ENDIF
C
C  MOVE TO THE STARTING POSITION...
C
    	IF( IR.GT.1 ) THEN
     	    XPS = ARRAY(1)
     	    YPS = ARRAY(2)
     	ELSE
     	    XPS = 0.0
     	    YPS = 0.0
     	ENDIF
     	BOLDFACE = .FALSE.
111	CALL IFDRAW( XPS, YPS, 3 )
C
C  LOAD THE LABEL...
C
     	IF( IPL.GT.NBS-NCH-3 ) CALL IFINIT_DUMP
     	IPB(IPL+1) = '~'
     	IPB(IPL+2) = 39
    	IPL = IPL + 2
    	DO  I=1, NCH
    	    IPL = IPL + 1
    	    IPB(IPL) = ICHAR(TEXT(I))
    	ENDDO
     	IPL = IPL + 1
    	IPB(IPL) = 3
     	IF( IFN.NE.3 .OR. BOLDFACE ) GOTO 222
     	BOLDFACE = .TRUE.
     	XPS = XPS + 0.015*COS(ANGLE*D2R)
     	YPS = YPS + 0.015*SIN(ANGLE*D2R)
     	GOTO 111
C
C  RESET ROTATION TO ZERO...
C
222	IF( IR.GT.4 .AND. ANGLE.NE.0.0 ) THEN
    	    IF( IPL.GT.NBS-4 ) CALL IFINIT_DUMP
     	    IPL = IPL + 1
     	    IPB(IPL) = 'w'
     	    CALL IFINIT_MBA(360.0-ANGLE)
    	ENDIF

999	RETURN
    	END

