Index: trunk/src_plugins/export_fidocadj/fidocadj.c =================================================================== --- trunk/src_plugins/export_fidocadj/fidocadj.c (revision 31199) +++ trunk/src_plugins/export_fidocadj/fidocadj.c (revision 31200) @@ -245,14 +245,18 @@ * default_font stroke thickness = 800 * giving sx = (4189+800)/(5333+800) ~= 0.813 */ + int scale, scret = pcb_text_old_scale(text, &scale); rnd_coord_t x0 = text->X; /*rnd_coord_t sx = text->BoundingBox.X2 - text->BoundingBox.X1; unused */ rnd_coord_t y0 = text->Y; /* rnd_coord_t sy = text->BoundingBox.Y2 - text->BoundingBox.Y1; unused */ - rnd_coord_t glyphy = 5789*(text->Scale); /* (ascent+descent)*Scale */ + rnd_coord_t glyphy = 5789*(rnd_coord_t)scale; /* (ascent+descent)*Scale */ rnd_coord_t glyphx = 813*(glyphy/1000); /* based on 'm' glyph dimensions */ glyphy = 10*glyphy/7; /* empirically determined */ glyphx = 10*glyphx/7; /* scaling voodoo */ + if (scret != 0) + pcb_io_incompat_save(PCB->Data, (pcb_any_obj_t *)text, "text-scale", "file format does not support different x and y direction text scale - using average scale", "Use the scale field, set scale_x and scale_y to 0"); + /*switch(text->Direction) { case 0: x0 += sx; Index: trunk/src_plugins/io_autotrax/write.c =================================================================== --- trunk/src_plugins/io_autotrax/write.c (revision 31199) +++ trunk/src_plugins/io_autotrax/write.c (revision 31200) @@ -437,6 +437,10 @@ int index = 0; + int scale; + if (pcb_text_old_scale(text, &scale) != 0) + pcb_io_incompat_save(NULL, (pcb_any_obj_t *)text, "text-scale", "file format does not support different x and y direction text scale - using average scale", "Use the scale field, set scale_x and scale_y to 0"); + TODO("why do we hardwire this here?") default_stroke_thickness = 200000; @@ -455,8 +459,8 @@ fputs("CS\r\n", ctx->f); else fputs("FS\r\n", ctx->f); - strokeThickness = PCB_SCALE_TEXT(default_stroke_thickness, text->Scale / 2); - textHeight = PCB_SCALE_TEXT(mHeight, text->Scale); + strokeThickness = PCB_SCALE_TEXT(default_stroke_thickness, scale / 2); + textHeight = PCB_SCALE_TEXT(mHeight, scale); rotation = 0; if (current_layer == 6 || current_layer == 8) /* back copper or silk */ autotrax_mirrored = 16; /* mirrored */ Index: trunk/src_plugins/io_kicad/write.c =================================================================== --- trunk/src_plugins/io_kicad/write.c (revision 31199) +++ trunk/src_plugins/io_kicad/write.c (revision 31200) @@ -309,6 +309,7 @@ rnd_coord_t textOffsetY; rnd_coord_t halfStringWidth; rnd_coord_t halfStringHeight; + int scale; if (!(kly->lyt & PCB_LYT_COPPER) && !(kly->lyt & PCB_LYT_SILK)) { pcb_io_incompat_save(ctx->pcb->Data, (pcb_any_obj_t *)text, "text-layer", "Kicad supports text only on copper or silk - omitting text object on misc layer", NULL); @@ -315,11 +316,14 @@ return; } + if (pcb_text_old_scale(text, &scale) != 0) + pcb_io_incompat_save(PCB->Data, (pcb_any_obj_t *)text, "text-scale", "file format does not support different x and y direction text scale - using average scale", "Use the scale field, set scale_x and scale_y to 0"); + fprintf(ctx->f, "%*s", ind, ""); rnd_fprintf(ctx->f, "(gr_text %[4] ", text->TextString); - defaultXSize = 5 * PCB_SCALE_TEXT(mWidth, text->Scale) / 6; /* IIRC kicad treats this as kerned width of upper case m */ + defaultXSize = 5 * PCB_SCALE_TEXT(mWidth, scale) / 6; /* IIRC kicad treats this as kerned width of upper case m */ defaultYSize = defaultXSize; - strokeThickness = PCB_SCALE_TEXT(defaultStrokeThickness, text->Scale / 2); + strokeThickness = PCB_SCALE_TEXT(defaultStrokeThickness, scale / 2); rotation = 0; textOffsetX = 0; textOffsetY = 0; Index: trunk/src_plugins/io_kicad_legacy/write.c =================================================================== --- trunk/src_plugins/io_kicad_legacy/write.c (revision 31199) +++ trunk/src_plugins/io_kicad_legacy/write.c (revision 31200) @@ -233,12 +233,16 @@ localFlag = 0; textlist_foreach(&layer->Text, &it, text) { if ((currentLayer < 16) || (currentLayer == 20) || (currentLayer == 21)) { /* copper or silk layer text */ + int scale; + if (pcb_text_old_scale(text, &scale) != 0) + pcb_io_incompat_save(PCB->Data, (pcb_any_obj_t *)text, "text-scale", "file format does not support different x and y direction text scale - using average scale", "Use the scale field, set scale_x and scale_y to 0"); + fputs("$TEXTPCB\nTe \"", FP); fputs(text->TextString, FP); fputs("\"\n", FP); - defaultXSize = 5 * PCB_SCALE_TEXT(mWidth, text->Scale) / 6; /* IIRC kicad treats this as kerned width of upper case m */ + defaultXSize = 5 * PCB_SCALE_TEXT(mWidth, scale) / 6; /* IIRC kicad treats this as kerned width of upper case m */ defaultYSize = defaultXSize; - strokeThickness = PCB_SCALE_TEXT(defaultStrokeThickness, text->Scale / 2); + strokeThickness = PCB_SCALE_TEXT(defaultStrokeThickness, scale / 2); rotation = 0; textOffsetX = 0; textOffsetY = 0; Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 31199) +++ trunk/src_plugins/io_pcb/file.c (revision 31200) @@ -438,12 +438,15 @@ pcb_io_incompat_save(sc->parent.data, (pcb_any_obj_t *)sc, "element-side", "Can not determine element side", "Missing or botched subc aux layer; can not tell if subc is on top or bottom layer, using top."); if (trefdes != NULL) { + int scale; + if (pcb_text_old_scale(trefdes, &scale) != 0) + pcb_io_incompat_save(sc->data, (pcb_any_obj_t *)trefdes, "text-scale", "file format does not support different x and y direction text scale - using average scale", "Use the scale field, set scale_x and scale_y to 0"); rx = trefdes->X - ox; ry = trefdes->Y - oy; if (!pcb_text_old_direction(&rdir, trefdes->rot)) { TODO("textrot: incompatibility warning") } - rscale = trefdes->Scale; + rscale = scale; } else { const char *tmp; @@ -634,10 +637,13 @@ } textlist_foreach(&layer->Text, &it, text) { int dir; + int scale; + if (pcb_text_old_scale(text, &scale) != 0) + pcb_io_incompat_save(PCB->Data, (pcb_any_obj_t *)text, "text-scale", "file format does not support different x and y direction text scale - using average scale", "Use the scale field, set scale_x and scale_y to 0"); if (!pcb_text_old_direction(&dir, text->rot)) { TODO("textrot: incompatibility warning") } - rnd_fprintf(FP, "\tText[%[0] %[0] %d %d ", text->X, text->Y, dir, text->Scale); + rnd_fprintf(FP, "\tText[%[0] %[0] %d %d ", text->X, text->Y, dir, scale); pcb_print_quoted_string(FP, (char *) RND_EMPTY(text->TextString)); fprintf(FP, " %s]\n", F2S(text, PCB_OBJ_TEXT)); } Index: trunk/src_plugins/io_tedax/tboard.c =================================================================== --- trunk/src_plugins/io_tedax/tboard.c (revision 31199) +++ trunk/src_plugins/io_tedax/tboard.c (revision 31200) @@ -203,9 +203,12 @@ const char **lyname = (const char **)vtp0_get(&ctx.g2n, rl->meta.real.grp, 0); if (lyname != NULL) { gds_t tmp; + int scale; + if (pcb_text_old_scale(text, &scale) != 0) + pcb_io_incompat_save(subc->data, (pcb_any_obj_t *)text, "text-scale", "file format does not support different x and y direction text scale - using average scale", "Use the scale field, set scale_x and scale_y to 0"); rnd_fprintf(f, " place_text %s %s %.06mm %.06mm %.06mm %.06mm %d %f ", refdes, *lyname, text->bbox_naked.X1, text->bbox_naked.Y1, text->bbox_naked.X2, text->bbox_naked.Y2, - text->Scale, text->rot); + scale, text->rot); gds_init(&tmp); pcb_append_dyntext(&tmp, (pcb_any_obj_t *)text, text->TextString); tedax_fprint_escape(f, tmp.array); Index: trunk/src_plugins/io_tedax/tlayer.c =================================================================== --- trunk/src_plugins/io_tedax/tlayer.c (revision 31199) +++ trunk/src_plugins/io_tedax/tlayer.c (revision 31200) @@ -109,12 +109,15 @@ { pcb_gfx_t *gfx; for(gfx = gfxlist_first(&ly->Gfx); gfx != NULL; gfx = gfxlist_next(gfx)) - pcb_io_incompat_save(PCB->Data, (pcb_any_obj_t *)gfx, "gfx", "gfx can not be exported", "please use the lihata board format"); + pcb_io_incompat_save(pcb->Data, (pcb_any_obj_t *)gfx, "gfx", "gfx can not be exported", "please use the lihata board format"); } PCB_TEXT_LOOP(ly) { + int scale; + if (pcb_text_old_scale(text, &scale) != 0) + pcb_io_incompat_save(pcb->Data, (pcb_any_obj_t *)text, "text-scale", "file format does not support different x and y direction text scale - using average scale", "Use the scale field, set scale_x and scale_y to 0"); rnd_fprintf(f, " text %.06mm %.06mm %.06mm %.06mm %d %f %.06mm ", text->bbox_naked.X1, text->bbox_naked.Y1, text->bbox_naked.X2, text->bbox_naked.Y2, - text->Scale, text->rot, PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, text) ? 1 : 0); + scale, text->rot, PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, text) ? 1 : 0); tedax_fprint_escape(f, text->TextString); fputc('\n', f); } PCB_END_LOOP;