home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / gle / gle / b_text.c < prev    next >
C/C++ Source or Header  |  1992-11-29  |  954b  |  54 lines

  1. #include "all.h"
  2. #include "mygraph.h"
  3. #include "justify.h"
  4.  
  5. #define true (!false)
  6. #define false 0
  7. #define dbg if ((gle_debug & 32)>0)
  8. extern int gle_debug;
  9.  
  10. extern long *(*gpcode)[];   /* gpcode is a polonger to an array of poiter to long */
  11. extern long (*gplen)[];   /* gpcode is a pointer to an array of long */
  12. extern int ngpcode;
  13.  
  14.  
  15. begin_text(int *pln,long *pcode, int *cp,double width)
  16. {
  17.     int sl,i,bl,cjust,z=0;
  18.     static char tbuff[2000];
  19.     bl = 0;
  20.     for (;;) {
  21.     /* showpcode(pcode); */
  22.     if (*(pcode+*cp-1)==0) { /* END XXX */
  23.         break;
  24.     }
  25.     z++;
  26.     if (z>2) {
  27.         sl = strlen((char *) (pcode+*cp));
  28.         dbg gprint("text == %d {%s} \n",sl,pcode+*cp);
  29.         strcpy(&tbuff[0] + bl,(char *) (pcode+*cp));
  30.         tbuff[bl+sl] = '\n';
  31.         bl = bl + sl + 1;
  32.     }
  33.     pcode = (*gpcode)[(*pln)++];
  34.     *cp = 2;
  35.     }
  36.     tbuff[bl] = 0;
  37.     (*pln)--;
  38.     dbg printf("Buffer length %d %d \n",bl,strlen(tbuff));
  39.    g_get_just(&cjust);
  40.     text_block(tbuff,width,cjust);
  41. }
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.