Ignore:
Timestamp:
02/27/08 07:09:03 (12 years ago)
Author:
Nicholas Riley
Message:

Jgraph: Debian changes by pzn@…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Jgraph/printline.c

    r418 r419  
    88#include "jgraph.h"
    99#include <stdio.h>
     10#include <assert.h> //by pzn@debian.org
    1011
    1112#define LINEWIDTHFACTOR 0.700
     
    229230  float fnl;
    230231  char *s;
     232  unsigned char *s_7bit; // added by pzn@debian.org
    231233
    232234  if (l->label == CNULL) return;
     
    267269
    268270  s = l->label;
     271 
    269272  for (i = 0; i <= nlines; i++) {
    270     printf("(%s) dup stringwidth pop ", s);
     273    // BEGIN added by pzn@debian.org
     274    // converts 8bit ascii chars to octal value;
     275    // 7bit are not converted
     276    {
     277       int i, j=0, len;
     278       len=strlen(s);
     279       s_7bit=malloc(len*4+1);
     280       assert(s_7bit!=NULL);
     281       for (i=0; i<=len; i++) {
     282         if((unsigned char)s[i]<128) {
     283           //char is ascii 7bit
     284           s_7bit[j]=s[i];
     285           j++;
     286         } else {
     287           //char must be converted to octal
     288           sprintf(s_7bit+j,"\\%03o",(unsigned char)s[i]);
     289           j+=4;
     290         }
     291       }
     292       s_7bit[j-1]=0;
     293    }
     294    //printf("(%s) dup stringwidth pop ", s); //disabled by pzn
     295    printf("(%s) dup stringwidth pop ", s_7bit); free(s_7bit);
     296    // END added by pzn
    271297    if (l->hj == 'c') {
    272298      printf("2 div neg 0 moveto\n");
Note: See TracChangeset for help on using the changeset viewer.