summaryrefslogtreecommitdiff
path: root/kicad
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-03 03:04:09 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-03 22:18:28 (GMT)
commit88f37cefd07b8c5bb5f9251a704807540f4c233d (patch)
treef84ccd59d42252e814520136af359c543319d701 /kicad
parent7d060257e316eb6a2a43345fbc0e2b8759221a1f (diff)
downloadeeshow-88f37cefd07b8c5bb5f9251a704807540f4c233d.zip
eeshow-88f37cefd07b8c5bb5f9251a704807540f4c233d.tar.gz
eeshow-88f37cefd07b8c5bb5f9251a704807540f4c233d.tar.bz2
kicad/lib-parse.c (lib_parse_line): accept short T records
Seems that they were common in the past - at least Qi-Hw's kicad-libs have them.
Diffstat (limited to 'kicad')
-rw-r--r--kicad/lib-parse.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/kicad/lib-parse.c b/kicad/lib-parse.c
index e2f8a29..74870c3 100644
--- a/kicad/lib-parse.c
+++ b/kicad/lib-parse.c
@@ -283,6 +283,28 @@ static bool lib_parse_line(const struct file *file,
&obj->u.text.dim, &zero, &obj->unit, &obj->convert,
&obj->u.text.s, &style, &bold,
&obj->u.text.hor_align, &obj->u.text.vert_align);
+
+ switch (n) {
+ case 8:
+ style= NULL;
+ n++;
+ /* fall through */
+ case 9:
+ bold = 0;
+ n++;
+ /* fall through */
+ case 10:
+ obj->u.text.hor_align = 'C';
+ n++;
+ /* fall through */
+ case 11:
+ obj->u.text.vert_align = 'C';
+ n++;
+ /* fall through */
+ default:
+ break;
+ }
+
while (n == 12) {
char *tilde;
@@ -296,7 +318,8 @@ static bool lib_parse_line(const struct file *file,
if (zero)
fatal("%u: only understand 0 x x\n"
"\"%s\"", file->lineno, line);
- obj->u.text.style = decode_style(style, bold);
+ obj->u.text.style =
+ style ? decode_style(style, bold) : text_normal;
obj->type = lib_obj_text;
free(style);
return 1;