1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-12-23 17:07:23 +02:00

sch2fig/lib.c (lib_parse): replace all ~ in unquoted strings with spaces

This commit is contained in:
Werner Almesberger 2016-07-26 17:37:35 -03:00
parent 252e92fe64
commit 0ddd4dbbb3
2 changed files with 10 additions and 2 deletions

View File

@ -4,7 +4,6 @@
- unify alignment, direction
- support fonts attributes ?
- support line thickness ?
- ~ as space (grep for ~ in out.fig)
- ~ as overline (grep for ~ in out.fig)
- glabel: build for "right" style, then rotate poly
- break into file reading, internal storage, rendering

View File

@ -603,13 +603,22 @@ bool lib_parse(struct lib_ctx *ctx, const char *line)
&obj->u.text.dim, &zero1, &obj->unit, &obj->convert,
&obj->u.text.s, &style, &zero2,
&obj->u.text.hor_align, &obj->u.text.vert_align);
if (n != 12)
if (n != 12) {
n = sscanf(line,
"T %d %d %d %d %u %u %u %ms %ms %u %c %c",
&obj->u.text.orient, &obj->u.text.x, &obj->u.text.y,
&obj->u.text.dim, &zero1, &obj->unit, &obj->convert,
&obj->u.text.s, &style, &zero2,
&obj->u.text.hor_align, &obj->u.text.vert_align);
while (n == 12) {
char *tilde;
tilde = strchr(obj->u.text.s, '~');
if (!tilde)
break;
*tilde = ' ';
}
}
if (n == 12) {
if (zero1 || zero2) {
fprintf(stderr, "%u: only understand 0 x x\n",