Changeset 419 for trunk/Jgraph/printline.c
- Timestamp:
- 02/27/08 07:09:03 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Jgraph/printline.c
r418 r419 8 8 #include "jgraph.h" 9 9 #include <stdio.h> 10 #include <assert.h> //by pzn@debian.org 10 11 11 12 #define LINEWIDTHFACTOR 0.700 … … 229 230 float fnl; 230 231 char *s; 232 unsigned char *s_7bit; // added by pzn@debian.org 231 233 232 234 if (l->label == CNULL) return; … … 267 269 268 270 s = l->label; 271 269 272 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 271 297 if (l->hj == 'c') { 272 298 printf("2 div neg 0 moveto\n");
Note:
See TracChangeset
for help on using the changeset viewer.