IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 6, 2005, 3:49:41 PM (21 years ago)
Author:
eugene
Message:

fixed postscript parenthesis error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa/graph/DrawRotString.c

    r5386 r5482  
    329329  char *c, *segment, basefont[64];
    330330  int i, N, code;
    331   int dX, dY, Xoff, Yoff, X, Y, Nseg, YoffBase;
     331  int dX, dY, Xoff, Yoff, X, Y, Nseg, NSEG, YoffBase;
    332332  double cs, sn, fscale;
    333333  int basesize;
     
    372372  fprintf (f, " %d %d moveto %f rotate\n", X, Y, -angle);
    373373
    374   ALLOCATE (segment, char, strlen (c)+2);
    375   bzero (segment, strlen (c)+2);
    376374  Nseg = 0;
     375  NSEG = strlen(c) + 2;
     376  ALLOCATE (segment, char, NSEG);
     377  bzero (segment, NSEG);
    377378
    378379  code = FALSE;
     
    385386    /* check for special characters */
    386387    if (!code) {
     388      /* superscript character (^) */
    387389      if (N == 94) {
    388390        PSDumpRotSegment (f, segment, &Nseg);
     
    394396        continue;
    395397      }
     398      /* subscript character (_) */
    396399      if (N == 95) {
    397400        PSDumpRotSegment (f, segment, &Nseg);
     
    403406        continue;
    404407      }
     408      /* end super/sub script (|) */
    405409      if (N == 124) {
    406410        PSDumpRotSegment (f, segment, &Nseg);
     
    411415        continue;
    412416      }
     417      /* escape char (\) */
    413418      if (N == 92) {
    414419        code = TRUE;
    415420        continue;
    416421      }
     422      /* begin paren (insert \) */
     423      if (N == 40) {
     424        code = FALSE;
     425        segment[Nseg] = 92;
     426        Nseg ++;
     427        CHECK_REALLOCATE (segment, char, NSEG, Nseg, 64);
     428      }
     429      /* end paren (insert \) */
     430      if (N == 41) {
     431        code = FALSE;
     432        segment[Nseg] = 92;
     433        Nseg ++;
     434        CHECK_REALLOCATE (segment, char, NSEG, Nseg, 64);
     435      }
     436      /* font change character (&) */
    417437      if (N == 38) {
    418438        PSDumpRotSegment (f, segment, &Nseg);
     
    440460    segment[Nseg] = N;
    441461    Nseg ++;
     462    CHECK_REALLOCATE (segment, char, NSEG, Nseg, 64);
    442463  }
    443464  PSDumpRotSegment (f, segment, &Nseg);
     
    447468}
    448469
    449 
    450470void PSDumpRotSegment (FILE *f, char *segment, int *Nseg) {
     471  segment[*Nseg] = 0;
    451472  fprintf (f, "(%s) show\n", segment);
    452473  bzero (segment, *Nseg);
Note: See TracChangeset for help on using the changeset viewer.