Selaa lähdekoodia

* Fixed syntax errors in the generated PostScript document if ( ) \ or

Unicode characters are encountered.
tags/v0.99.beta14
Sam Hocevar sam 19 vuotta sitten
vanhempi
commit
6a0861c9b3
1 muutettua tiedostoa jossa 18 lisäystä ja 1 poistoa
  1. +18
    -1
      cucul/export_ps.c

+ 18
- 1
cucul/export_ps.c Näytä tiedosto

@@ -107,11 +107,28 @@ void _cucul_get_ps(cucul_t *qq, struct cucul_buffer *ex)

for(x = 0; x < qq->width; x++)
{
uint32_t c = *linechar++;

cur += sprintf(cur, "newpath\n");
cur += sprintf(cur, "%d %d moveto\n", (x + 1) * 6, y * 10);
cur += sprintf(cur, "%s setrgbcolor\n",
palette[*lineattr++ & 0x0f]);
cur += sprintf(cur, "(%c) show\n", *linechar++ & 0x7f);

if(c < 0x00000020)
cur += sprintf(cur, "(?) show\n");
else if(c >= 0x00000080)
cur += sprintf(cur, "(?) show\n");
else switch((uint8_t)(c & 0x7f))
{
case '\\': cur += sprintf(cur, "(\\\\) show\n"); break;
case '(': cur += sprintf(cur, "(\\() show\n"); break;
case ')':
cur += sprintf(cur, "(\\%c) show\n", c);
break;
default:
cur += sprintf(cur, "(%c) show\n", c);
break;
}
}
}



Ladataan…
Peruuta
Tallenna