Index: read.c =================================================================== --- read.c (revision 33999) +++ read.c (revision 34000) @@ -1030,7 +1030,7 @@ static int parse_pcb_text(lht_read_t *rctx, pcb_layer_t *ly, lht_node_t *obj) { pcb_text_t *text; - lht_node_t *role, *nthickness, *nrot, *ndir; + lht_node_t *role, *nthickness, *nclearance, *nrot, *ndir; int tmp, err = 0, dir; unsigned char intconn = 0; long int id; @@ -1068,6 +1068,7 @@ err |= parse_text(&text->TextString, hash_get(obj, "string", 0)); nthickness = lht_dom_hash_get(obj, "thickness"); + nclearance = lht_dom_hash_get(obj, "clearance"); nrot = lht_dom_hash_get(obj, "rot"); ndir = lht_dom_hash_get(obj, "direction"); @@ -1080,6 +1081,14 @@ else text->thickness = 0; + if (nclearance != NULL) { + if (rctx->rdver < 8) + iolht_warn(rctx, nthickness, -1, "Text clearance should not be present in a file with version lower than v8\n"); + err |= parse_coord(&text->clearance, nclearance); + } + else + text->clearance = 0; + if ((ndir != NULL) && (rctx->rdver >= 6)) iolht_warn(rctx, nthickness, -1, "Text direction should not be present in a file with version higher than v5 - use text rot instead\n"); Index: write.c =================================================================== --- write.c (revision 33999) +++ write.c (revision 34000) @@ -753,6 +753,15 @@ lht_dom_hash_put(obj, build_textf("x", CFMT, text->X)); lht_dom_hash_put(obj, build_textf("y", CFMT, text->Y)); + if (wrver >= 8) { + if (text->clearance != 0) + lht_dom_hash_put(obj, build_textf("clearance", CFMT, text->clearance)); + else + lht_dom_hash_put(obj, dummy_text_node("clearance")); + } + else if (text->clearance != 0) + pcb_io_incompat_save(NULL, (pcb_any_obj_t *)text, "text-clearance", "file format does not support custom text clearance value", "do not use text clearance or save in lihata >=v8"); + if (wrver >= 7) { if (text->Scale != 0) lht_dom_hash_put(obj, build_textf("scale", "%d", text->Scale));