#include "all.h"
#include "mygraph.h"
#include "justify.h"

#define true (!false)
#define false 0
#define dbg if ((gle_debug & 32)>0)
extern int gle_debug;

extern int32 *(*gpcode)[];   /* gpcode is a polonger to an array of poiter to int32 */
extern int32 (*gplen)[];   /* gpcode is a pointer to an array of int32 */
extern int ngpcode;


begin_text(int *pln,int32 *pcode, int *cp,double width)
{
    int sl,i,bl,cjust,z=0;
    static char tbuff[2000];
    bl = 0;
    for (;;) {
	/* showpcode(pcode); */
	if (*(pcode+*cp-1)==0) { /* END XXX */
		break;
	}
	z++;
	if (z>2) {
		sl = strlen((char *) (pcode+*cp));
		dbg gprint("text == %d {%s} \n",sl,pcode+*cp);
		strcpy(&tbuff[0] + bl,(char *) (pcode+*cp));
		tbuff[bl+sl] = '\n';
		bl = bl + sl + 1;
	}
	pcode = (*gpcode)[(*pln)++];
	*cp = 2;
    }
	tbuff[bl] = 0;
	(*pln)--;
    dbg printf("Buffer length %d %d \n",bl,strlen(tbuff));
   g_get_just(&cjust);
    text_block(UC tbuff,width,cjust);
}













