home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 344b.lha / plplot_v2.6 / src / plcvec.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-01-27  |  719 b   |  41 lines

  1. /* Gets the character digitisation of Hershey table entry "char" */
  2. /* Returns 1 if there is a valid entry */
  3.  
  4. extern short int *fntbffr;
  5. extern short int *fntindx;
  6. extern short int indxleng;
  7.  
  8. #include "plplot.h"
  9. #define STLEN     250
  10.  
  11. static SCHAR xygrid[STLEN];
  12.  
  13. struct point {
  14.    SCHAR x, y;
  15. };
  16.  
  17. PLINT plcvec(ch,xygr)
  18. PLINT ch;
  19. SCHAR **xygr;
  20. {
  21.  
  22.    PLINT k=0, ib;
  23.    struct point *pt;
  24.  
  25.    ch--;
  26.    if (ch < 0 || ch >= indxleng) return((PLINT)0);
  27.    ib = fntindx[ch]-2;
  28.    if (ib == -2) return((PLINT)0);
  29.  
  30.    do {
  31.      ib++;
  32.      pt = (struct point *)&fntbffr[ib];
  33.      xygrid[k++]=pt->x;
  34.      xygrid[k++]=pt->y;
  35.    } while ((pt->x != 64 || pt->y != 64) && k <= (STLEN-2));
  36.  
  37.    *xygr = xygrid;
  38.    return((PLINT)1);
  39. }
  40.  
  41.