Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 7013) +++ trunk/src/action_helper.c (revision 7014) @@ -903,7 +903,7 @@ if (pcb_layer_flags(INDEXOFCURRENT) & PCB_LYT_BOTTOM) flag |= PCB_FLAG_ONSOLDER; - if ((text = pcb_text_new(CURRENT, &PCB->Font, Note.X, + if ((text = pcb_text_new(CURRENT, pcb_font(PCB, 0, 1), Note.X, Note.Y, 0, conf_core.design.text_scale, string, pcb_flag_make(flag))) != NULL) { pcb_undo_add_obj_to_create(PCB_TYPE_TEXT, CURRENT, text, text); pcb_undo_inc_serial(); @@ -1082,7 +1082,7 @@ pcb_r_delete_entry(PCB->Data->name_tree[i], (pcb_box_t *) & (e->Name[i])); memcpy(&(e->Name[i]), &(estr[i]), sizeof(pcb_text_t)); e->Name[i].Element = e; - pcb_text_bbox(&PCB->Font, &(e->Name[i])); + pcb_text_bbox(pcb_font(PCB, 0, 1), &(e->Name[i])); pcb_r_insert_entry(PCB->Data->name_tree[i], (pcb_box_t *) & (e->Name[i]), 0); if (i == save_n) DrawElementName(e); Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 7013) +++ trunk/src/board.c (revision 7014) @@ -52,8 +52,7 @@ pcb_data_free(pcb->Data); free(pcb->Data); /* release font symbols */ - for (i = 0; i <= PCB_MAX_FONTPOSITION; i++) - free(pcb->Font.Symbol[i].Line); + pcb_fontkit_free(&pcb->fontkit); for (i = 0; i < PCB_NUM_NETLISTS; i++) pcb_lib_free(&(pcb->NetlistLib[i])); vtroutestyle_uninit(&pcb->RouteStyle); Index: trunk/src/board.h =================================================================== --- trunk/src/board.h (revision 7013) +++ trunk/src/board.h (revision 7014) @@ -94,7 +94,7 @@ double Zoom, /* zoom factor */ IsleArea, /* minimum poly island to retain */ ThermScale; /* scale factor used with thermals */ - pcb_font_t Font; + pcb_fontkit_t fontkit; pcb_layer_stack_t LayerGroups; vtroutestyle_t RouteStyle; pcb_lib_t NetlistLib[PCB_NUM_NETLISTS]; Index: trunk/src/font.c =================================================================== --- trunk/src/font.c (revision 7013) +++ trunk/src/font.c (revision 7014) @@ -86,7 +86,7 @@ { int res = -1; pcb_io_err_inhibit_inc(); - conf_list_foreach_path_first(res, &conf_core.rc.default_font_file, pcb_parse_font(&pcb->Font, __path__)); + conf_list_foreach_path_first(res, &conf_core.rc.default_font_file, pcb_parse_font(&pcb->fontkit.dflt, __path__)); pcb_io_err_inhibit_dec(); if (res != 0) { @@ -94,7 +94,7 @@ gds_t buff; s = conf_concat_strlist(&conf_core.rc.default_font_file, &buff, NULL, ':'); pcb_message(PCB_MSG_WARNING, _("Can't find font-symbol-file. Searched: '%s'; falling back to the embedded default font\n"), s); - pcb_font_load_internal(&pcb->Font); + pcb_font_load_internal(&pcb->fontkit.dflt); gds_uninit(&buff); } } @@ -188,13 +188,10 @@ pcb_font_t *pcb_font(pcb_board_t *pcb, pcb_font_id_t id, int fallback) { -#if 0 if (id == 0) - return pcb->fontkit->dflt; + return &pcb->fontkit.dflt; - return pcb->fontkit->dflt; /* temporary, compatibility solution */ -#endif - return &pcb->Font; + return &pcb->fontkit.dflt; /* temporary, compatibility solution */ } static void pcb_font_free(pcb_font_t *f) @@ -206,6 +203,5 @@ void pcb_fontkit_free(pcb_fontkit_t *fk) { -/* pcb_font_free(fontkit->dflt);*/ - pcb_font_free(&PCB->Font); + pcb_font_free(&fk->dflt); } Index: trunk/src/font.h =================================================================== --- trunk/src/font.h (revision 7013) +++ trunk/src/font.h (revision 7014) @@ -45,11 +45,11 @@ pcb_coord_t MaxHeight, MaxWidth; /* maximum cell width and height */ pcb_box_t DefaultSymbol; /* the default symbol is a filled box */ pcb_symbol_t Symbol[PCB_MAX_FONTPOSITION + 1]; - pcb_bool Valid; }; struct pcb_fontkit_s { /* a set of unrelated fonts */ pcb_font_t dflt; /* default, fallback font, also the sysfont */ + pcb_bool valid; }; typedef int pcb_font_id_t; /* a font is referenced by a pcb_board_t:pcb_font_id_t pair */ Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 7013) +++ trunk/src/obj_elem.c (revision 7014) @@ -274,7 +274,7 @@ if (Buffer->Data->pcb == 0) Buffer->Data->pcb = PCB; - Element = pcb_element_new(PCB->Data, NULL, &PCB->Font, pcb_no_flags(), + Element = pcb_element_new(PCB->Data, NULL, pcb_font(PCB, 0, 1), pcb_no_flags(), NULL, NULL, NULL, PCB_PASTEBUFFER->X, PCB_PASTEBUFFER->Y, 0, 100, pcb_flag_make(PCB_SWAP_IDENT ? PCB_FLAG_ONSOLDER : PCB_FLAG_NO), pcb_false); if (!Element) @@ -393,7 +393,7 @@ Element->MarkY = Buffer->Y; if (PCB_SWAP_IDENT) PCB_FLAG_SET(PCB_FLAG_ONSOLDER, Element); - pcb_element_bbox(PCB->Data, Element, &PCB->Font); + pcb_element_bbox(PCB->Data, Element, pcb_font(PCB, 0, 1)); pcb_buffer_clear(Buffer); pcb_move_obj_to_buffer(Buffer->Data, PCB->Data, PCB_TYPE_ELEMENT, Element, Element, Element); pcb_set_buffer_bbox(Buffer); @@ -452,7 +452,7 @@ PCB_END_LOOP; pcb_rotate(&Element->MarkX, &Element->MarkY, X, Y, cosa, sina); - pcb_element_bbox(Data, Element, &PCB->Font); + pcb_element_bbox(Data, Element, pcb_font(PCB, 0, 1)); pcb_poly_clear_from_poly(Data, PCB_TYPE_ELEMENT, Element, Element); } @@ -504,7 +504,7 @@ pcb_r_delete_entry(data->name_tree[which], &Element->Name[which].BoundingBox); Element->Name[which].TextString = new_name; - pcb_text_bbox(&PCB->Font, &Element->Name[which]); + pcb_text_bbox(pcb_font(PCB, 0, 1), &Element->Name[which]); pcb_r_insert_entry(data->name_tree[which], &Element->Name[which].BoundingBox, 0); @@ -523,7 +523,7 @@ pcb_element_destroy(Dest); /* both coordinates and flags are the same */ - Dest = pcb_element_new(Data, Dest, &PCB->Font, + Dest = pcb_element_new(Data, Dest, pcb_font(PCB, 0, 1), pcb_flag_mask(Src->Flags, PCB_FLAG_FOUND), PCB_ELEM_NAME_DESCRIPTION(Src), PCB_ELEM_NAME_REFDES(Src), PCB_ELEM_NAME_VALUE(Src), PCB_ELEM_TEXT_DESCRIPTION(Src).X + dx, @@ -566,7 +566,7 @@ Dest->MarkX = Src->MarkX + dx; Dest->MarkY = Src->MarkY + dy; - pcb_element_bbox(Data, Dest, &PCB->Font); + pcb_element_bbox(Data, Dest, pcb_font(PCB, 0, 1)); return (Dest); } @@ -720,7 +720,7 @@ /* now toggle the solder-side flag */ PCB_FLAG_TOGGLE(PCB_FLAG_ONSOLDER, Element); /* this inserts all of the rtree data too */ - pcb_element_bbox(Data, Element, &PCB->Font); + pcb_element_bbox(Data, Element, pcb_font(PCB, 0, 1)); pcb_poly_clear_from_poly(Data, PCB_TYPE_ELEMENT, Element, Element); } @@ -1128,7 +1128,7 @@ PCB_END_LOOP; PCB_COORD_ROTATE90(Element->MarkX, Element->MarkY, X, Y, Number); /* SetElementBoundingBox reenters the rtree data */ - pcb_element_bbox(Data, Element, &PCB->Font); + pcb_element_bbox(Data, Element, pcb_font(PCB, 0, 1)); pcb_poly_clear_from_poly(Data, PCB_TYPE_ELEMENT, Element, Element); } @@ -1286,7 +1286,7 @@ PCB_FLAG_CLEAR(PCB_FLAG_WARN | PCB_FLAG_FOUND, pad); } PCB_END_LOOP; - pcb_element_bbox(ctx->buffer.dst, element, &PCB->Font); + pcb_element_bbox(ctx->buffer.dst, element, pcb_font(PCB, 0, 1)); /* * Now clear the from the polygons in the destination */ @@ -1415,7 +1415,7 @@ pad->Thickness = value; } /* SetElementBB updates all associated rtrees */ - pcb_element_bbox(PCB->Data, Element, &PCB->Font); + pcb_element_bbox(PCB->Data, Element, pcb_font(PCB, 0, 1)); pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PAD, Element, pad); DrawPad(pad); @@ -1482,7 +1482,7 @@ pcb_undo_add_obj_to_size(PCB_TYPE_ELEMENT_NAME, Element, text, text); pcb_r_delete_entry(PCB->Data->name_tree[n], (pcb_box_t *) text); text->Scale = value; - pcb_text_bbox(&PCB->Font, text); + pcb_text_bbox(pcb_font(PCB, 0, 1), text); pcb_r_insert_entry(PCB->Data->name_tree[n], (pcb_box_t *) text, 0); } PCB_END_LOOP; Index: trunk/src/obj_pad.c =================================================================== --- trunk/src/obj_pad.c (revision 7013) +++ trunk/src/obj_pad.c (revision 7014) @@ -192,7 +192,7 @@ Pad->Mask += value - Pad->Thickness; Pad->Thickness = value; /* SetElementBB updates all associated rtrees */ - pcb_element_bbox(PCB->Data, Element, &PCB->Font); + pcb_element_bbox(PCB->Data, Element, pcb_font(PCB, 0, 1)); pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PAD, Element, Pad); DrawPad(Pad); return (Pad); @@ -223,7 +223,7 @@ pcb_r_delete_entry(PCB->Data->pad_tree, &Pad->BoundingBox); Pad->Clearance = value; /* SetElementBB updates all associated rtrees */ - pcb_element_bbox(PCB->Data, Element, &PCB->Font); + pcb_element_bbox(PCB->Data, Element, pcb_font(PCB, 0, 1)); pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PAD, Element, Pad); DrawPad(Pad); return Pad; @@ -311,7 +311,7 @@ ErasePad(Pad); pcb_r_delete_entry(PCB->Data->pad_tree, &Pad->BoundingBox); Pad->Mask = value; - pcb_element_bbox(PCB->Data, Element, &PCB->Font); + pcb_element_bbox(PCB->Data, Element, pcb_font(PCB, 0, 1)); DrawPad(Pad); return (Pad); } Index: trunk/src/obj_pinvia.c =================================================================== --- trunk/src/obj_pinvia.c (revision 7013) +++ trunk/src/obj_pinvia.c (revision 7014) @@ -455,7 +455,7 @@ Pin->Mask += value - Pin->Thickness; Pin->Thickness = value; /* SetElementBB updates all associated rtrees */ - pcb_element_bbox(PCB->Data, Element, &PCB->Font); + pcb_element_bbox(PCB->Data, Element, pcb_font(PCB, 0, 1)); pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PIN, Element, Pin); DrawPin(Pin); return (Pin); @@ -485,7 +485,7 @@ pcb_r_delete_entry(PCB->Data->pin_tree, &Pin->BoundingBox); Pin->Clearance = value; /* SetElementBB updates all associated rtrees */ - pcb_element_bbox(PCB->Data, Element, &PCB->Font); + pcb_element_bbox(PCB->Data, Element, pcb_font(PCB, 0, 1)); pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_PIN, Element, Pin); DrawPin(Pin); return (Pin); @@ -714,7 +714,7 @@ ErasePin(Pin); pcb_r_delete_entry(PCB->Data->pin_tree, &Pin->BoundingBox); Pin->Mask = value; - pcb_element_bbox(PCB->Data, Element, &PCB->Font); + pcb_element_bbox(PCB->Data, Element, pcb_font(PCB, 0, 1)); DrawPin(Pin); return (Pin); } Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 7013) +++ trunk/src/obj_text.c (revision 7014) @@ -221,7 +221,7 @@ { pcb_layer_t *layer = &ctx->buffer.dst->Layer[pcb_layer_id(ctx->buffer.src, Layer)]; - return (pcb_text_new(layer, &PCB->Font, Text->X, Text->Y, Text->Direction, Text->Scale, Text->TextString, pcb_flag_mask(Text->Flags, ctx->buffer.extraflg))); + return (pcb_text_new(layer, pcb_font(PCB, 0, 1), Text->X, Text->Y, Text->Direction, Text->Scale, Text->TextString, pcb_flag_mask(Text->Flags, ctx->buffer.extraflg))); } /* moves a text to buffer without allocating memory for the name */ @@ -256,7 +256,7 @@ pcb_r_delete_entry(Layer->text_tree, (pcb_box_t *) Text); pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_TEXT, Layer, Text); Text->Scale = value; - pcb_text_bbox(&PCB->Font, Text); + pcb_text_bbox(pcb_font(PCB, 0, 1), Text); pcb_r_insert_entry(Layer->text_tree, (pcb_box_t *) Text, 0); pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_TEXT, Layer, Text); DrawText(Layer, Text); @@ -279,7 +279,7 @@ Text->TextString = ctx->chgname.new_name; /* calculate size of the bounding box */ - pcb_text_bbox(&PCB->Font, Text); + pcb_text_bbox(pcb_font(PCB, 0, 1), Text); pcb_r_insert_entry(Layer->text_tree, (pcb_box_t *) Text, 0); pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_TEXT, Layer, Text); DrawText(Layer, Text); @@ -327,7 +327,7 @@ { pcb_text_t *text; - text = pcb_text_new(Layer, &PCB->Font, Text->X + ctx->copy.DeltaX, + text = pcb_text_new(Layer, pcb_font(PCB, 0, 1), Text->X + ctx->copy.DeltaX, Text->Y + ctx->copy.DeltaY, Text->Direction, Text->Scale, Text->TextString, pcb_flag_mask(Text->Flags, PCB_FLAG_FOUND)); DrawText(Layer, text); pcb_undo_add_obj_to_create(PCB_TYPE_TEXT, Layer, text, text); @@ -367,7 +367,7 @@ PCB_FLAG_CLEAR(PCB_FLAG_ONSOLDER, text); /* re-calculate the bounding box (it could be mirrored now) */ - pcb_text_bbox(&PCB->Font, text); + pcb_text_bbox(pcb_font(PCB, 0, 1), text); if (!Destination->text_tree) Destination->text_tree = pcb_r_create_tree(NULL, 0, 0); pcb_r_insert_entry(Destination->text_tree, (pcb_box_t *) text, 0); @@ -469,7 +469,7 @@ text->X = PCB_SWAP_X(text->X); text->Y = PCB_SWAP_Y(text->Y); PCB_FLAG_TOGGLE(PCB_FLAG_ONSOLDER, text); - pcb_text_bbox(&PCB->Font, text); + pcb_text_bbox(pcb_font(PCB, 0, 1), text); pcb_r_insert_entry(layer->text_tree, (pcb_box_t *) text, 0); } @@ -483,7 +483,7 @@ pcb_coord_t x = 0; unsigned char *string = (unsigned char *) Text->TextString; pcb_cardinal_t n; - pcb_font_t *font = &PCB->Font; + pcb_font_t *font = pcb_font(PCB, 0, 1); while (string && *string) { /* draw lines if symbol is valid and data is present */ @@ -526,7 +526,8 @@ } else { /* the default symbol is a filled box */ - pcb_box_t defaultsymbol = PCB->Font.DefaultSymbol; + pcb_font_t *font = pcb_font(PCB, 0, 1); + pcb_box_t defaultsymbol = font->DefaultSymbol; pcb_coord_t size = (defaultsymbol.X2 - defaultsymbol.X1) * 6 / 5; defaultsymbol.X1 = PCB_SCALE_TEXT(defaultsymbol.X1 + x, Text->Scale); Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 7013) +++ trunk/src/plug_io.c (revision 7014) @@ -367,7 +367,7 @@ PCB = newPCB; /* mark the default font invalid to know if the file has one */ - newPCB->Font.Valid = pcb_false; + newPCB->fontkit.valid = pcb_false; switch(how & 0x0F) { case 0: settings_dest = CFR_DESIGN; break; @@ -393,10 +393,10 @@ } /* enable default font if necessary */ - if (!PCB->Font.Valid) { + if (!PCB->fontkit.valid) { if ((require_font) && (!PCB->is_footprint)) pcb_message(PCB_MSG_WARNING, _("File '%s' has no font information, using default font\n"), new_filename); - PCB->Font.Valid = pcb_true; + PCB->fontkit.valid = pcb_true; } /* clear 'changed flag' */ Index: trunk/src_plugins/draw_csect/draw_csect.c =================================================================== --- trunk/src_plugins/draw_csect/draw_csect.c (revision 7013) +++ trunk/src_plugins/draw_csect/draw_csect.c (revision 7014) @@ -273,7 +273,7 @@ { pcb_text_t *t; t = dtext_bg(gc, x, y, 200, 0, label, COLOR_BG, COLOR_ANNOT); - pcb_text_bbox(&PCB->Font, t); + pcb_text_bbox(pcb_font(PCB, 0, 1), t); dhrect(PCB_COORD_TO_MM(t->BoundingBox.X1), y, PCB_COORD_TO_MM(t->BoundingBox.X2)+1, y+4, 0.25, 0, 0, 0, OMIT_NONE); box->X1 = t->BoundingBox.X1; box->Y1 = PCB_MM_TO_COORD(y); @@ -367,7 +367,7 @@ if (lid == drag_lid) continue; t = dtext_bg(gc, x, y, 200, 0, l->Name, COLOR_BG, l->Color); - pcb_text_bbox(&PCB->Font, t); + pcb_text_bbox(pcb_font(PCB, 0, 1), t); x += PCB_COORD_TO_MM(t->BoundingBox.X2 - t->BoundingBox.X1) + 3; dhrect(PCB_COORD_TO_MM(t->BoundingBox.X1), y, PCB_COORD_TO_MM(t->BoundingBox.X2)+1, y+4, 0.25, 0, 0, 0, OMIT_NONE); reg_layer_coords(lid, t->BoundingBox.X1, PCB_MM_TO_COORD(y), t->BoundingBox.X2+PCB_MM_TO_COORD(1), PCB_MM_TO_COORD(y+4)); Index: trunk/src_plugins/draw_fab/draw_fab.c =================================================================== --- trunk/src_plugins/draw_fab/draw_fab.c (revision 7013) +++ trunk/src_plugins/draw_fab/draw_fab.c (revision 7014) @@ -71,7 +71,7 @@ int w = 0, i; pcb_text_t t; va_list a; - pcb_font_t *font = &PCB->Font; + pcb_font_t *font = pcb_font(PCB, 0, 1); va_start(a, fmt); vsprintf(tmp, fmt, a); va_end(a); Index: trunk/src_plugins/fontmode/fontmode.c =================================================================== --- trunk/src_plugins/fontmode/fontmode.c (revision 7013) +++ trunk/src_plugins/fontmode/fontmode.c (revision 7014) @@ -111,7 +111,7 @@ lwidth = PCB->Data->Layer + 2; lgrid = PCB->Data->Layer + 3; - font = &PCB->Font; + font = pcb_font(PCB, 0, 1); for (s = 0; s <= PCB_MAX_FONTPOSITION; s++) { pcb_coord_t ox = (s % 16 + 1) * CELL_SIZE; pcb_coord_t oy = (s / 16 + 1) * CELL_SIZE; @@ -169,7 +169,7 @@ gdl_iterator_t it; pcb_layer_t *lfont, *lwidth; - font = &PCB->Font; + font = pcb_font(PCB, 0, 1); lfont = PCB->Data->Layer + 0; lwidth = PCB->Data->Layer + 2; @@ -189,7 +189,7 @@ s = XYtoSym(x1, y1); ox = (s % 16 + 1) * CELL_SIZE; oy = (s / 16 + 1) * CELL_SIZE; - symbol = &PCB->Font.Symbol[s]; + symbol = &font->Symbol[s]; x1 -= ox; y1 -= oy; @@ -212,7 +212,7 @@ s = XYtoSym(x1, y1); ox = (s % 16 + 1) * CELL_SIZE; - symbol = &PCB->Font.Symbol[s]; + symbol = &font->Symbol[s]; x1 -= ox; Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c (revision 7013) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c (revision 7014) @@ -141,7 +141,7 @@ if (layer == NULL) return NULL; - res = pcb_text_new(layer, &PCB->Font, x, y, direction, scale, pcb_strdup(str), get_flags(flags)); + res = pcb_text_new(layer, pcb_font(PCB, 0, 1), x, y, direction, scale, pcb_strdup(str), get_flags(flags)); return search_persist_created(search_id, layer_id, res, OM_ARC); } Index: trunk/src_plugins/import_hyp/parser.c =================================================================== --- trunk/src_plugins/import_hyp/parser.c (revision 7013) +++ trunk/src_plugins/import_hyp/parser.c (revision 7014) @@ -1064,7 +1064,7 @@ /* place the device at (0.0) for the moment being. when a pin is assigned, move the position to the pin position */ - pcb_element_new(hyp_dest, NULL, &PCB->Font, pcb_no_flags(), description, name, value, text_x, text_y, text_direction, + pcb_element_new(hyp_dest, NULL, pcb_font(PCB, 0, 1), pcb_no_flags(), description, name, value, text_x, text_y, text_direction, text_scale, pcb_no_flags(), pcb_false); return 0; @@ -1462,7 +1462,7 @@ /* if necessary, create a device to connect the pad to */ component = pcb_search_elem_by_name(hyp_dest, pad_component); if (component == NULL) - component = pcb_element_new(hyp_dest, NULL, &PCB->Font, pcb_no_flags(), pad_component, pad_component, "?", + component = pcb_element_new(hyp_dest, NULL, pcb_font(PCB, 0, 1), pcb_no_flags(), pad_component, pad_component, "?", x2coord(h->x), y2coord(h->y), text_direction, text_scale, pcb_no_flags(), pcb_false); /* add new pad */ Index: trunk/src_plugins/io_kicad/read.c =================================================================== --- trunk/src_plugins/io_kicad/read.c (revision 7013) +++ trunk/src_plugins/io_kicad/read.c (revision 7014) @@ -298,7 +298,8 @@ } required = BV(0) | BV(1) | BV(2) | BV(3); if ((tally & required) == required) { /* has location, layer, size and stroke thickness at a minimum */ - if (&st->PCB->Font == NULL) { +#warning TODO: this will never be NULL; what are we trying to check here? + if (&st->PCB->fontkit.dflt == NULL) { pcb_font_create_default(st->PCB); } @@ -336,7 +337,7 @@ } } - pcb_text_new( &st->PCB->Data->Layer[PCBLayer], &st->PCB->Font, X, Y, direction, scaling, text, Flags); + pcb_text_new( &st->PCB->Data->Layer[PCBLayer], pcb_font(st->PCB, 0, 1), X, Y, direction, scaling, text, Flags); return 0; /* create new font */ } return -1; @@ -1287,7 +1288,8 @@ } required = BV(0) | BV(1) | BV(4) | BV(7) | BV(8); if ((tally & required) == required) { /* has location, layer, size and stroke thickness at a minimum */ - if (&st->PCB->Font == NULL) { +#warning TODO: this will never be NULL; what are we trying to check here? + if (&st->PCB->fontkit.dflt == NULL) { pcb_font_create_default(st->PCB); } @@ -1334,7 +1336,7 @@ moduleDefined = 1; /* but might be empty, wait and see */ printf("now have RefDes %s and Value %s, can now define module/element %s\n", moduleRefdes, moduleValue, moduleName); newModule = pcb_element_new(st->PCB->Data, NULL, - &st->PCB->Font, Flags, + pcb_font(st->PCB, 0, 1), Flags, moduleName, moduleRefdes, moduleValue, moduleX, moduleY, direction, refdesScaling, TextFlags, pcb_false); /*pcb_flag_t TextFlags, pcb_bool uniqueName) */ @@ -1887,7 +1889,7 @@ pcb_element_line_new(newModule, moduleX, moduleY, moduleX+1, moduleY+1, Thickness); pcb_printf("\tEmpty Module!! 1nm line created at module centroid.\n"); } - pcb_element_bbox(PCB->Data, newModule, &PCB->Font); + pcb_element_bbox(PCB->Data, newModule, pcb_font(PCB, 0, 1)); return 0; } else { return -1; Index: trunk/src_plugins/io_kicad/write.c =================================================================== --- trunk/src_plugins/io_kicad/write.c (revision 7013) +++ trunk/src_plugins/io_kicad/write.c (revision 7014) @@ -708,7 +708,7 @@ int write_kicad_layout_text(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation) { - pcb_font_t *myfont = &PCB->Font; + pcb_font_t *myfont = pcb_font(PCB, 0, 1); pcb_coord_t mWidth = myfont->MaxWidth; /* kicad needs the width of the widest letter */ pcb_coord_t defaultStrokeThickness = 100*2540; /* use 100 mil as default 100% stroked font line thickness */ int kicadMirrored = 1; /* 1 is not mirrored, 0 is mirrored */ Index: trunk/src_plugins/io_kicad_legacy/write.c =================================================================== --- trunk/src_plugins/io_kicad_legacy/write.c (revision 7013) +++ trunk/src_plugins/io_kicad_legacy/write.c (revision 7014) @@ -663,7 +663,7 @@ int write_kicad_legacy_layout_text(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset) { - pcb_font_t *myfont = &PCB->Font; + pcb_font_t *myfont = pcb_font(PCB, 0, 1); pcb_coord_t mWidth = myfont->MaxWidth; /* kicad needs the width of the widest letter */ pcb_coord_t defaultStrokeThickness = 100*2540; /* use 100 mil as default 100% stroked font line thickness */ int kicadMirrored = 1; /* 1 is not mirrored, 0 is mirrored */ Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 7013) +++ trunk/src_plugins/io_lihata/read.c (revision 7014) @@ -524,7 +524,7 @@ #warning TODO: get the font if (ly != NULL) - pcb_add_text_on_layer(ly, text, &PCB->Font); + pcb_add_text_on_layer(ly, text, pcb_font(PCB, 0, 1)); if (el != NULL) text->Element = el; @@ -694,7 +694,7 @@ /* Make sure we use some sort of font */ if (pcb == NULL) pcb = PCB; - pcb_element_bbox(dt, elem, &pcb->Font); + pcb_element_bbox(dt, elem, pcb_font(PCB, 0, 1)); return 0; } @@ -857,7 +857,6 @@ } } - font->Valid = 1; return 0; } @@ -1031,9 +1030,11 @@ return -1; sub = lht_dom_hash_get(nd, "font"); - if ((sub != NULL) && (parse_font(&pcb->Font, sub) != 0)) + if ((sub != NULL) && (parse_font(pcb_font(PCB, 0, 1), sub) != 0)) return -1; + PCB->fontkit.valid = 1; + sub = lht_dom_hash_get(nd, "styles"); if ((sub != NULL) && (parse_styles(&pcb->RouteStyle, sub) != 0)) return -1; Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 7013) +++ trunk/src_plugins/io_lihata/write.c (revision 7014) @@ -777,7 +777,7 @@ lht_dom_hash_put(brd->root, build_board_meta(pcb)); lht_dom_hash_put(brd->root, build_data(pcb->Data)); lht_dom_hash_put(brd->root, build_attributes(&pcb->Attributes)); - lht_dom_hash_put(brd->root, build_font(&pcb->Font)); + lht_dom_hash_put(brd->root, build_font(&pcb->fontkit.dflt)); lht_dom_hash_put(brd->root, build_styles(&pcb->RouteStyle)); lht_dom_hash_put(brd->root, build_netlists(pcb, pcb->NetlistLib, pcb->NetlistPatches, PCB_NUM_NETLISTS)); lht_dom_hash_put(brd->root, build_conf()); Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 7013) +++ trunk/src_plugins/io_pcb/file.c (revision 7014) @@ -317,7 +317,7 @@ pcb_line_t *line; pcb_font_t *font; - for (font = &PCB->Font, i = 0; i <= PCB_MAX_FONTPOSITION; i++) { + for (font = pcb_font(PCB, 0, 1), i = 0; i <= PCB_MAX_FONTPOSITION; i++) { if (!font->Symbol[i].Valid) continue; @@ -595,7 +595,7 @@ if (!yyPCB) return; - yyFont = &yyPCB->Font; + yyFont = &yyPCB->fontkit.dflt; yyData = yyPCB->Data; yyData->pcb = yyPCB; yyData->LayerN = 0; Index: trunk/src_plugins/io_pcb/parse_l.c =================================================================== --- trunk/src_plugins/io_pcb/parse_l.c (revision 7013) +++ trunk/src_plugins/io_pcb/parse_l.c (revision 7014) @@ -27,8 +27,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 1 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -107,13 +107,25 @@ #endif /* ! FLEXINT_H */ -/* TODO: this is always defined, so inline it */ +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST #define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) #else -#define yynoreturn +#define yyconst #endif /* Returned upon end-of-file. */ @@ -169,11 +181,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - extern int pcb_leng; extern FILE *pcb_in, *pcb_out; @@ -184,7 +191,7 @@ /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE pcb_lex. + * existing scanners that call yyless() from OUTSIDE pcb_lex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-pcb_lineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. @@ -196,13 +203,6 @@ if ( pcb_text[yyl] == '\n' )\ --pcb_lineno;\ }while(0) - #define YY_LINENO_REWIND_TO(dst) \ - do {\ - const char *p;\ - for ( p = yy_cp-1; p >= (dst); --p)\ - if ( *p == '\n' )\ - --pcb_lineno;\ - }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -220,6 +220,11 @@ #define unput(c) yyunput( c, (yytext_ptr) ) +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -232,7 +237,7 @@ /* Size of input buffer in bytes, not including room for EOB * characters. */ - int yy_buf_size; + yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -260,7 +265,7 @@ int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -288,7 +293,7 @@ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -311,7 +316,7 @@ int pcb_leng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; +static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -370,7 +375,7 @@ typedef unsigned char YY_CHAR; -FILE *pcb_in = NULL, *pcb_out = NULL; +FILE *pcb_in = (FILE *) 0, *pcb_out = (FILE *) 0; typedef int yy_state_type; @@ -379,15 +384,12 @@ int pcb_lineno = 1; extern char *pcb_text; -#ifdef yytext_ptr -#undef yytext_ptr -#endif #define yytext_ptr pcb_text static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); -static void yynoreturn yy_fatal_error (yyconst char* msg ); +static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up pcb_text. @@ -394,7 +396,7 @@ */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - pcb_leng = (int) (yy_cp - yy_bp); \ + pcb_leng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; @@ -437,7 +439,7 @@ 0 } ; -static yyconst YY_CHAR yy_ec[256] = +static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -469,7 +471,7 @@ 1, 1, 1, 1, 1 } ; -static yyconst YY_CHAR yy_meta[51] = +static yyconst flex_int32_t yy_meta[51] = { 0, 1, 1, 2, 3, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, @@ -478,7 +480,7 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_uint16_t yy_base[226] = +static yyconst flex_int16_t yy_base[226] = { 0, 0, 0, 256, 257, 253, 257, 257, 46, 0, 0, 42, 45, 46, 13, 16, 230, 213, 23, 207, 208, @@ -536,7 +538,7 @@ 0, 221, 221, 221, 221 } ; -static yyconst flex_uint16_t yy_nxt[308] = +static yyconst flex_int16_t yy_nxt[308] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 4, 12, 13, 14, 4, 15, 16, 17, 18, 19, 20, 21, @@ -713,6 +715,7 @@ pcb_font_t * yyFont; conf_role_t yy_settings_dest; pcb_flag_t yy_pcb_flags; +int *yyFontkitValid; static int parse_number (void); @@ -726,7 +729,7 @@ */ static int Parse(FILE *Pipe, const char *Executable, const char *Path, const char *Filename); -#line 730 "parse_l.c" +#line 733 "parse_l.c" #define INITIAL 0 @@ -759,19 +762,19 @@ FILE *pcb_get_in (void ); -void pcb_set_in (FILE * _in_str ); +void pcb_set_in (FILE * in_str ); FILE *pcb_get_out (void ); -void pcb_set_out (FILE * _out_str ); +void pcb_set_out (FILE * out_str ); - int pcb_get_leng (void ); +int pcb_get_leng (void ); char *pcb_get_text (void ); int pcb_get_lineno (void ); -void pcb_set_lineno (int _line_number ); +void pcb_set_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -785,12 +788,8 @@ #endif #endif -#ifndef YY_NO_UNPUT - static void yyunput (int c,char *buf_ptr ); -#endif - #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -824,7 +823,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( pcb_text, (size_t) pcb_leng, 1, pcb_out )) {} } while (0) +#define ECHO do { if (fwrite( pcb_text, pcb_leng, 1, pcb_out )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -848,7 +847,7 @@ else \ { \ errno=0; \ - while ( (result = (int) fread(buf, 1, max_size, pcb_in))==0 && ferror(pcb_in)) \ + while ( (result = fread(buf, 1, max_size, pcb_in))==0 && ferror(pcb_in)) \ { \ if( errno != EINTR) \ { \ @@ -903,7 +902,7 @@ /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; +#define YY_BREAK break; #endif #define YY_RULE_SETUP \ @@ -913,10 +912,15 @@ */ YY_DECL { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; +#line 108 "parse_l.l" + + +#line 923 "parse_l.c" + if ( !(yy_init) ) { (yy_init) = 1; @@ -943,13 +947,7 @@ pcb__load_buffer_state( ); } - { -#line 107 "parse_l.l" - - -#line 951 "parse_l.c" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -965,7 +963,7 @@ yy_match: do { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -977,7 +975,7 @@ if ( yy_current_state >= 222 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 257 ); @@ -995,10 +993,10 @@ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { - yy_size_t yyl; + int yyl; for ( yyl = 0; yyl < pcb_leng; ++yyl ) if ( pcb_text[yyl] == '\n' ) - + pcb_lineno++; ; } @@ -1016,227 +1014,227 @@ case 1: YY_RULE_SETUP -#line 109 "parse_l.l" +#line 110 "parse_l.l" { return(T_FILEVERSION); } YY_BREAK case 2: YY_RULE_SETUP -#line 110 "parse_l.l" +#line 111 "parse_l.l" { return(T_PCB); } YY_BREAK case 3: YY_RULE_SETUP -#line 111 "parse_l.l" +#line 112 "parse_l.l" { return(T_GRID); } YY_BREAK case 4: YY_RULE_SETUP -#line 112 "parse_l.l" +#line 113 "parse_l.l" { return(T_CURSOR); } YY_BREAK case 5: YY_RULE_SETUP -#line 113 "parse_l.l" +#line 114 "parse_l.l" { return(T_THERMAL); } YY_BREAK case 6: YY_RULE_SETUP -#line 114 "parse_l.l" +#line 115 "parse_l.l" { return(T_AREA); } YY_BREAK case 7: YY_RULE_SETUP -#line 115 "parse_l.l" +#line 116 "parse_l.l" { return(T_DRC); } YY_BREAK case 8: YY_RULE_SETUP -#line 116 "parse_l.l" +#line 117 "parse_l.l" { return(T_FLAGS); } YY_BREAK case 9: YY_RULE_SETUP -#line 117 "parse_l.l" +#line 118 "parse_l.l" { return(T_LAYER); } YY_BREAK case 10: YY_RULE_SETUP -#line 118 "parse_l.l" +#line 119 "parse_l.l" { return(T_PIN); } YY_BREAK case 11: YY_RULE_SETUP -#line 119 "parse_l.l" +#line 120 "parse_l.l" { return(T_PAD); } YY_BREAK case 12: YY_RULE_SETUP -#line 120 "parse_l.l" +#line 121 "parse_l.l" { return(T_VIA); } YY_BREAK case 13: YY_RULE_SETUP -#line 121 "parse_l.l" +#line 122 "parse_l.l" { return(T_LINE); } YY_BREAK case 14: YY_RULE_SETUP -#line 122 "parse_l.l" +#line 123 "parse_l.l" { return(T_RAT); } YY_BREAK case 15: YY_RULE_SETUP -#line 123 "parse_l.l" +#line 124 "parse_l.l" { return(T_RECTANGLE); } YY_BREAK case 16: YY_RULE_SETUP -#line 124 "parse_l.l" +#line 125 "parse_l.l" { return(T_TEXT); } YY_BREAK case 17: YY_RULE_SETUP -#line 125 "parse_l.l" +#line 126 "parse_l.l" { return(T_ELEMENTLINE); } YY_BREAK case 18: YY_RULE_SETUP -#line 126 "parse_l.l" +#line 127 "parse_l.l" { return(T_ELEMENTARC); } YY_BREAK case 19: YY_RULE_SETUP -#line 127 "parse_l.l" +#line 128 "parse_l.l" { return(T_ELEMENT); } YY_BREAK case 20: YY_RULE_SETUP -#line 128 "parse_l.l" +#line 129 "parse_l.l" { return(T_SYMBOLLINE); } YY_BREAK case 21: YY_RULE_SETUP -#line 129 "parse_l.l" +#line 130 "parse_l.l" { return(T_SYMBOL); } YY_BREAK case 22: YY_RULE_SETUP -#line 130 "parse_l.l" +#line 131 "parse_l.l" { return(T_MARK); } YY_BREAK case 23: YY_RULE_SETUP -#line 131 "parse_l.l" +#line 132 "parse_l.l" { return(T_GROUPS); } YY_BREAK case 24: YY_RULE_SETUP -#line 132 "parse_l.l" +#line 133 "parse_l.l" { return(T_STYLES); } YY_BREAK case 25: YY_RULE_SETUP -#line 133 "parse_l.l" +#line 134 "parse_l.l" { return(T_POLYGON); } YY_BREAK case 26: YY_RULE_SETUP -#line 134 "parse_l.l" +#line 135 "parse_l.l" { return(T_POLYGON_HOLE); } YY_BREAK case 27: YY_RULE_SETUP -#line 135 "parse_l.l" +#line 136 "parse_l.l" { return(T_ARC); } YY_BREAK case 28: YY_RULE_SETUP -#line 136 "parse_l.l" +#line 137 "parse_l.l" { return(T_NETLIST); } YY_BREAK case 29: YY_RULE_SETUP -#line 137 "parse_l.l" +#line 138 "parse_l.l" { return(T_NET); } YY_BREAK case 30: YY_RULE_SETUP -#line 138 "parse_l.l" +#line 139 "parse_l.l" { return(T_CONN); } YY_BREAK case 31: YY_RULE_SETUP -#line 139 "parse_l.l" +#line 140 "parse_l.l" { return(T_NETLISTPATCH); } YY_BREAK case 32: YY_RULE_SETUP -#line 140 "parse_l.l" +#line 141 "parse_l.l" { return(T_ADD_CONN); } YY_BREAK case 33: YY_RULE_SETUP -#line 141 "parse_l.l" +#line 142 "parse_l.l" { return(T_DEL_CONN); } YY_BREAK case 34: YY_RULE_SETUP -#line 142 "parse_l.l" +#line 143 "parse_l.l" { return(T_CHANGE_ATTRIB); } YY_BREAK case 35: YY_RULE_SETUP -#line 143 "parse_l.l" +#line 144 "parse_l.l" { return(T_ATTRIBUTE); } YY_BREAK case 36: YY_RULE_SETUP -#line 145 "parse_l.l" +#line 146 "parse_l.l" { return T_NM; } YY_BREAK case 37: YY_RULE_SETUP -#line 146 "parse_l.l" +#line 147 "parse_l.l" { return T_UM; } YY_BREAK case 38: YY_RULE_SETUP -#line 147 "parse_l.l" +#line 148 "parse_l.l" { return T_MM; } YY_BREAK case 39: YY_RULE_SETUP -#line 148 "parse_l.l" +#line 149 "parse_l.l" { return T_M; } YY_BREAK case 40: YY_RULE_SETUP -#line 149 "parse_l.l" +#line 150 "parse_l.l" { return T_KM; } YY_BREAK case 41: YY_RULE_SETUP -#line 150 "parse_l.l" +#line 151 "parse_l.l" { return T_UMIL; } YY_BREAK case 42: YY_RULE_SETUP -#line 151 "parse_l.l" +#line 152 "parse_l.l" { return T_CMIL; } YY_BREAK case 43: YY_RULE_SETUP -#line 152 "parse_l.l" +#line 153 "parse_l.l" { return T_MIL; } YY_BREAK case 44: YY_RULE_SETUP -#line 153 "parse_l.l" +#line 154 "parse_l.l" { return T_IN; } YY_BREAK case 45: YY_RULE_SETUP -#line 155 "parse_l.l" +#line 156 "parse_l.l" { pcb_lval.integer = (unsigned) *(pcb_text+1); return(CHAR_CONST); @@ -1244,17 +1242,17 @@ YY_BREAK case 46: YY_RULE_SETUP -#line 159 "parse_l.l" +#line 160 "parse_l.l" { return parse_number(); } YY_BREAK case 47: YY_RULE_SETUP -#line 160 "parse_l.l" +#line 161 "parse_l.l" { pcb_lval.integer = pcb_round (strtod (pcb_text, NULL)); return INTEGER; } YY_BREAK case 48: YY_RULE_SETUP -#line 162 "parse_l.l" +#line 163 "parse_l.l" { unsigned n; sscanf((char *) pcb_text, "%x", &n); pcb_lval.integer = n; @@ -1263,7 +1261,7 @@ YY_BREAK case 49: YY_RULE_SETUP -#line 167 "parse_l.l" +#line 168 "parse_l.l" { char *p1, *p2; @@ -1299,18 +1297,18 @@ YY_BREAK case 50: YY_RULE_SETUP -#line 199 "parse_l.l" +#line 200 "parse_l.l" {} YY_BREAK case 51: YY_RULE_SETUP -#line 200 "parse_l.l" +#line 201 "parse_l.l" {} YY_BREAK case 52: /* rule 52 can match eol */ YY_RULE_SETUP -#line 201 "parse_l.l" +#line 202 "parse_l.l" { #ifndef FLEX_SCANNER pcb_lineno++; @@ -1319,20 +1317,20 @@ YY_BREAK case 53: YY_RULE_SETUP -#line 206 "parse_l.l" +#line 207 "parse_l.l" {} YY_BREAK case 54: YY_RULE_SETUP -#line 207 "parse_l.l" +#line 208 "parse_l.l" { return(*pcb_text); } YY_BREAK case 55: YY_RULE_SETUP -#line 209 "parse_l.l" +#line 210 "parse_l.l" ECHO; YY_BREAK -#line 1336 "parse_l.c" +#line 1334 "parse_l.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1463,7 +1461,6 @@ "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of user's declarations */ } /* end of pcb_lex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1475,9 +1472,9 @@ */ static int yy_get_next_buffer (void) { - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - yy_size_t number_to_move, i; + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1506,7 +1503,7 @@ /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1526,7 +1523,7 @@ { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); @@ -1546,7 +1543,7 @@ } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; + b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1564,7 +1561,7 @@ /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1588,9 +1585,9 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) pcb_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); @@ -1609,14 +1606,14 @@ static yy_state_type yy_get_previous_state (void) { - yy_state_type yy_current_state; - char *yy_cp; + register yy_state_type yy_current_state; + register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1628,7 +1625,7 @@ if ( yy_current_state >= 222 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; @@ -1641,10 +1638,10 @@ */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); - YY_CHAR yy_c = 1; + register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1656,17 +1653,15 @@ if ( yy_current_state >= 222 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 221); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } -#ifndef YY_NO_UNPUT - - static void yyunput (int c, char * yy_bp ) + static void yyunput (int c, register char * yy_bp ) { - char *yy_cp; + register char *yy_cp; yy_cp = (yy_c_buf_p); @@ -1676,10 +1671,10 @@ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - int number_to_move = (yy_n_chars) + 2; - char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - char *source = + register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1688,7 +1683,7 @@ yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -1705,8 +1700,6 @@ (yy_c_buf_p) = yy_cp; } -#endif - #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1755,7 +1748,7 @@ case EOB_ACT_END_OF_FILE: { if ( pcb_wrap( ) ) - return 0; + return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1778,7 +1771,7 @@ (yy_hold_char) = *++(yy_c_buf_p); if ( c == '\n' ) - + pcb_lineno++; ; @@ -1861,7 +1854,7 @@ if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in pcb__create_buffer()" ); - b->yy_buf_size = (yy_size_t)size; + b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. @@ -1896,6 +1889,10 @@ pcb_free((void *) b ); } +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a pcb_restart() or at EOF. @@ -2016,15 +2013,15 @@ * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)pcb_alloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in pcb_ensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -2033,7 +2030,7 @@ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; + int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)pcb_realloc @@ -2053,7 +2050,7 @@ * @param base the character buffer * @param size the size in bytes of the character buffer * - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE pcb__scan_buffer (char * base, yy_size_t size ) { @@ -2063,7 +2060,7 @@ base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return NULL; + return 0; b = (YY_BUFFER_STATE) pcb_alloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) @@ -2072,7 +2069,7 @@ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; + b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; @@ -2095,7 +2092,7 @@ YY_BUFFER_STATE pcb__scan_string (yyconst char * yystr ) { - return pcb__scan_bytes(yystr,(int) strlen(yystr) ); + return pcb__scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to pcb_lex() will @@ -2110,10 +2107,10 @@ YY_BUFFER_STATE b; char *buf; yy_size_t n; - yy_size_t i; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) _yybytes_len + 2; + n = _yybytes_len + 2; buf = (char *) pcb_alloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in pcb__scan_bytes()" ); @@ -2139,9 +2136,9 @@ #define YY_EXIT_FAILURE 2 #endif -static void yynoreturn yy_fatal_error (yyconst char* msg ) +static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2169,7 +2166,7 @@ */ int pcb_get_lineno (void) { - + return pcb_lineno; } @@ -2207,29 +2204,29 @@ } /** Set the current line number. - * @param _line_number line number + * @param line_number * */ -void pcb_set_lineno (int _line_number ) +void pcb_set_lineno (int line_number ) { - pcb_lineno = _line_number; + pcb_lineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param _in_str A readable stream. + * @param in_str A readable stream. * * @see pcb__switch_to_buffer */ -void pcb_set_in (FILE * _in_str ) +void pcb_set_in (FILE * in_str ) { - pcb_in = _in_str ; + pcb_in = in_str ; } -void pcb_set_out (FILE * _out_str ) +void pcb_set_out (FILE * out_str ) { - pcb_out = _out_str ; + pcb_out = out_str ; } int pcb_get_debug (void) @@ -2237,9 +2234,9 @@ return pcb__flex_debug; } -void pcb_set_debug (int _bdebug ) +void pcb_set_debug (int bdebug ) { - pcb__flex_debug = _bdebug ; + pcb__flex_debug = bdebug ; } static int yy_init_globals (void) @@ -2251,10 +2248,10 @@ /* We do not touch pcb_lineno unless the option is enabled. */ pcb_lineno = 1; - (yy_buffer_stack) = NULL; + (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; + (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; @@ -2263,8 +2260,8 @@ pcb_in = stdin; pcb_out = stdout; #else - pcb_in = NULL; - pcb_out = NULL; + pcb_in = (FILE *) 0; + pcb_out = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by @@ -2302,8 +2299,7 @@ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - - int i; + register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -2312,7 +2308,7 @@ #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - int n; + register int n; for ( n = 0; s[n]; ++n ) ; @@ -2322,12 +2318,11 @@ void *pcb_alloc (yy_size_t size ) { - return malloc(size); + return (void *) malloc( size ); } void *pcb_realloc (void * ptr, yy_size_t size ) { - /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2335,17 +2330,17 @@ * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return realloc(ptr, size); + return (void *) realloc( (char *) ptr, size ); } void pcb_free (void * ptr ) { - free( (char *) ptr ); /* see pcb_realloc() for (char *) cast */ + free( (char *) ptr ); /* see pcb_realloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 209 "parse_l.l" +#line 210 "parse_l.l" @@ -2464,7 +2459,8 @@ yy_settings_dest = CFR_invalid; yyPCB = NULL; yyData = Ptr; - yyFont = &PCB->Font; + yyFont = pcb_font(PCB, 0, 1); + yyFontkitValid = NULL; yyElement = NULL; f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &st); @@ -2507,6 +2503,7 @@ yyPCB = Ptr; yyData = NULL; yyFont = NULL; + yyFontkitValid = NULL; yyElement = NULL; yy_settings_dest = settings_dest; if (settings_dest != CFR_invalid) @@ -2577,9 +2574,10 @@ */ int io_pcb_ParseFont(pcb_plug_io_t *ctx, pcb_font_t *Ptr, const char *Filename) { - int r = 0; + int r = 0, valid; yyPCB = NULL; yyFont = Ptr; + yyFontkitValid = &valid; yyElement = NULL; yy_settings_dest = CFR_invalid; Index: trunk/src_plugins/io_pcb/parse_l.h =================================================================== --- trunk/src_plugins/io_pcb/parse_l.h (revision 7013) +++ trunk/src_plugins/io_pcb/parse_l.h (revision 7014) @@ -12,8 +12,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 1 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -92,13 +92,25 @@ #endif /* ! FLEXINT_H */ -/* TODO: this is always defined, so inline it */ +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST #define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) #else -#define yynoreturn +#define yyconst #endif /* Size of default input buffer. */ @@ -119,15 +131,15 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +extern int pcb_leng; + +extern FILE *pcb_in, *pcb_out; + #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif -extern int pcb_leng; - -extern FILE *pcb_in, *pcb_out; - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -140,7 +152,7 @@ /* Size of input buffer in bytes, not including room for EOB * characters. */ - int yy_buf_size; + yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -168,7 +180,7 @@ int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -200,9 +212,6 @@ extern int pcb_lineno; extern char *pcb_text; -#ifdef yytext_ptr -#undef yytext_ptr -#endif #define yytext_ptr pcb_text #ifdef YY_HEADER_EXPORT_START_CONDITIONS @@ -237,19 +246,19 @@ FILE *pcb_get_in (void ); -void pcb_set_in (FILE * _in_str ); +void pcb_set_in (FILE * in_str ); FILE *pcb_get_out (void ); -void pcb_set_out (FILE * _out_str ); +void pcb_set_out (FILE * out_str ); - int pcb_get_leng (void ); +int pcb_get_leng (void ); char *pcb_get_text (void ); int pcb_get_lineno (void ); -void pcb_set_lineno (int _line_number ); +void pcb_set_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -315,9 +324,9 @@ #undef YY_DECL #endif -#line 209 "parse_l.l" +#line 210 "parse_l.l" -#line 322 "parse_l.h" +#line 331 "parse_l.h" #undef pcb_IN_HEADER #endif /* pcb_HEADER_H */ Index: trunk/src_plugins/io_pcb/parse_l.l =================================================================== --- trunk/src_plugins/io_pcb/parse_l.l (revision 7013) +++ trunk/src_plugins/io_pcb/parse_l.l (revision 7014) @@ -79,6 +79,7 @@ pcb_font_t * yyFont; conf_role_t yy_settings_dest; pcb_flag_t yy_pcb_flags; +int *yyFontkitValid; static int parse_number (void); @@ -323,7 +324,8 @@ yy_settings_dest = CFR_invalid; yyPCB = NULL; yyData = Ptr; - yyFont = &PCB->Font; + yyFont = pcb_font(PCB, 0, 1); + yyFontkitValid = NULL; yyElement = NULL; f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &st); @@ -366,6 +368,7 @@ yyPCB = Ptr; yyData = NULL; yyFont = NULL; + yyFontkitValid = NULL; yyElement = NULL; yy_settings_dest = settings_dest; if (settings_dest != CFR_invalid) @@ -436,9 +439,10 @@ */ int io_pcb_ParseFont(pcb_plug_io_t *ctx, pcb_font_t *Ptr, const char *Filename) { - int r = 0; + int r = 0, valid; yyPCB = NULL; yyFont = Ptr; + yyFontkitValid = &valid; yyElement = NULL; yy_settings_dest = CFR_invalid; Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 7013) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 7014) @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.4" +#define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -137,6 +137,7 @@ extern char *yyfilename; /* in this file */ extern conf_role_t yy_settings_dest; extern pcb_flag_t yy_pcb_flags; +extern int *yyFontkitValid; static char *layer_group_string; @@ -166,7 +167,7 @@ #include "parse_y.h" -#line 170 "parse_y.c" /* yacc.c:339 */ +#line 171 "parse_y.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -254,10 +255,10 @@ /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - +typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 112 "parse_y.y" /* yacc.c:355 */ +#line 113 "parse_y.y" /* yacc.c:355 */ int integer; double number; @@ -265,10 +266,8 @@ pcb_flag_t flagtype; PLMeasure measure; -#line 269 "parse_y.c" /* yacc.c:355 */ +#line 270 "parse_y.c" /* yacc.c:355 */ }; - -typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif @@ -282,7 +281,7 @@ /* Copy the second part of user declarations. */ -#line 286 "parse_y.c" /* yacc.c:358 */ +#line 285 "parse_y.c" /* yacc.c:358 */ #ifdef short # undef short @@ -584,28 +583,28 @@ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 139, 139, 140, 141, 142, 166, 166, 224, 224, - 235, 235, 254, 255, 260, 260, 300, 302, 332, 339, - 346, 376, 377, 378, 381, 389, 404, 438, 444, 450, - 466, 468, 493, 495, 526, 528, 529, 530, 534, 544, - 555, 582, 586, 591, 619, 623, 667, 676, 685, 689, - 690, 694, 695, 699, 700, 700, 701, 702, 704, 704, - 711, 715, 716, 717, 718, 719, 755, 765, 776, 786, - 796, 832, 837, 869, 868, 896, 897, 901, 902, 906, - 907, 908, 909, 910, 911, 913, 918, 919, 920, 921, - 921, 922, 952, 961, 970, 1018, 1027, 1036, 1073, 1083, - 1101, 1151, 1150, 1189, 1191, 1196, 1195, 1202, 1204, 1209, - 1213, 1273, 1274, 1275, 1276, 1277, 1285, 1284, 1303, 1302, - 1321, 1320, 1341, 1339, 1363, 1361, 1442, 1443, 1447, 1448, - 1449, 1450, 1451, 1453, 1458, 1463, 1468, 1473, 1478, 1483, - 1483, 1487, 1488, 1492, 1493, 1494, 1495, 1497, 1503, 1510, - 1515, 1520, 1520, 1561, 1573, 1585, 1596, 1612, 1666, 1680, - 1693, 1704, 1715, 1716, 1720, 1721, 1743, 1745, 1761, 1780, - 1781, 1784, 1786, 1787, 1808, 1815, 1831, 1832, 1836, 1841, - 1842, 1846, 1847, 1871, 1870, 1880, 1881, 1885, 1886, 1905, - 1922, 1923, 1927, 1932, 1933, 1937, 1938, 1953, 1954, 1955, - 1982, 1990, 1991, 1995, 1996, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010 + 0, 140, 140, 141, 142, 143, 167, 167, 226, 226, + 237, 237, 256, 257, 262, 262, 302, 304, 334, 341, + 348, 378, 379, 380, 383, 391, 406, 440, 446, 452, + 468, 470, 495, 497, 528, 530, 531, 532, 536, 546, + 557, 584, 588, 593, 621, 625, 669, 678, 687, 691, + 692, 696, 697, 701, 702, 702, 703, 704, 706, 706, + 713, 717, 718, 719, 720, 721, 757, 767, 778, 788, + 798, 834, 839, 871, 870, 898, 899, 903, 904, 908, + 909, 910, 911, 912, 913, 915, 920, 921, 922, 923, + 923, 924, 954, 963, 972, 1020, 1029, 1038, 1075, 1085, + 1103, 1153, 1152, 1191, 1193, 1198, 1197, 1204, 1206, 1211, + 1215, 1275, 1276, 1277, 1278, 1279, 1287, 1286, 1305, 1304, + 1323, 1322, 1343, 1341, 1365, 1363, 1444, 1445, 1449, 1450, + 1451, 1452, 1453, 1455, 1460, 1465, 1470, 1475, 1480, 1485, + 1485, 1489, 1490, 1494, 1495, 1496, 1497, 1499, 1505, 1512, + 1517, 1522, 1522, 1563, 1575, 1587, 1598, 1614, 1668, 1682, + 1695, 1706, 1717, 1718, 1722, 1723, 1745, 1747, 1763, 1782, + 1783, 1786, 1788, 1789, 1810, 1817, 1833, 1834, 1838, 1843, + 1844, 1848, 1849, 1873, 1872, 1882, 1883, 1887, 1888, 1907, + 1924, 1925, 1929, 1934, 1935, 1939, 1940, 1955, 1956, 1957, + 1984, 1992, 1993, 1997, 1998, 2003, 2004, 2005, 2006, 2007, + 2008, 2009, 2010, 2011, 2012 }; #endif @@ -1782,13 +1781,13 @@ switch (yyn) { case 5: -#line 142 "parse_y.y" /* yacc.c:1646 */ +#line 143 "parse_y.y" /* yacc.c:1646 */ { YYABORT; } -#line 1788 "parse_y.c" /* yacc.c:1646 */ +#line 1787 "parse_y.c" /* yacc.c:1646 */ break; case 6: -#line 166 "parse_y.y" /* yacc.c:1646 */ +#line 167 "parse_y.y" /* yacc.c:1646 */ { /* reset flags for 'used layers'; * init font and data pointers @@ -1802,7 +1801,8 @@ } for (i = 0; i < PCB_MAX_LAYER + 2; i++) LayerFlag[i] = pcb_false; - yyFont = &yyPCB->Font; + yyFont = &yyPCB->fontkit.dflt; + yyFontkitValid = &yyPCB->fontkit.valid; yyData = yyPCB->Data; yyData->pcb = yyPCB; yyData->LayerN = 0; @@ -1814,7 +1814,7 @@ break; case 7: -#line 201 "parse_y.y" /* yacc.c:1646 */ +#line 203 "parse_y.y" /* yacc.c:1646 */ { pcb_board_t *pcb_save = PCB; if ((yy_settings_dest != CFR_invalid) && (layer_group_string != NULL)) @@ -1841,7 +1841,7 @@ break; case 8: -#line 224 "parse_y.y" /* yacc.c:1646 */ +#line 226 "parse_y.y" /* yacc.c:1646 */ { PreLoadElementPCB (); layer_group_string = NULL; } #line 1848 "parse_y.c" /* yacc.c:1646 */ @@ -1848,7 +1848,7 @@ break; case 9: -#line 227 "parse_y.y" /* yacc.c:1646 */ +#line 229 "parse_y.y" /* yacc.c:1646 */ { LayerFlag[0] = pcb_true; LayerFlag[1] = pcb_true; yyData->LayerN = 2; @@ -1858,7 +1858,7 @@ break; case 10: -#line 235 "parse_y.y" /* yacc.c:1646 */ +#line 237 "parse_y.y" /* yacc.c:1646 */ { /* reset flags for 'used layers'; * init font and data pointers @@ -1878,7 +1878,7 @@ break; case 14: -#line 260 "parse_y.y" /* yacc.c:1646 */ +#line 262 "parse_y.y" /* yacc.c:1646 */ { /* mark all symbols invalid */ int i; @@ -1888,7 +1888,7 @@ pcb_message(PCB_MSG_ERROR, "illegal fileformat\n"); YYABORT; } - yyFont->Valid = pcb_false; + *yyFontkitValid = pcb_false; for (i = 0; i <= PCB_MAX_FONTPOSITION; i++) free (yyFont->Symbol[i].Line); memset(yyFont->Symbol, 0, sizeof(yyFont->Symbol)); @@ -1897,9 +1897,9 @@ break; case 15: -#line 275 "parse_y.y" /* yacc.c:1646 */ +#line 277 "parse_y.y" /* yacc.c:1646 */ { - yyFont->Valid = pcb_true; + *yyFontkitValid = pcb_true; pcb_font_set_info(yyFont); } #line 1906 "parse_y.c" /* yacc.c:1646 */ @@ -1906,7 +1906,7 @@ break; case 17: -#line 303 "parse_y.y" /* yacc.c:1646 */ +#line 305 "parse_y.y" /* yacc.c:1646 */ { if (check_file_version ((yyvsp[-1].integer)) != 0) { @@ -1917,7 +1917,7 @@ break; case 18: -#line 333 "parse_y.y" /* yacc.c:1646 */ +#line 335 "parse_y.y" /* yacc.c:1646 */ { yyPCB->Name = (yyvsp[-1].string); yyPCB->MaxWidth = PCB_MAX_COORD; @@ -1928,7 +1928,7 @@ break; case 19: -#line 340 "parse_y.y" /* yacc.c:1646 */ +#line 342 "parse_y.y" /* yacc.c:1646 */ { yyPCB->Name = (yyvsp[-3].string); yyPCB->MaxWidth = OU ((yyvsp[-2].measure)); @@ -1939,7 +1939,7 @@ break; case 20: -#line 347 "parse_y.y" /* yacc.c:1646 */ +#line 349 "parse_y.y" /* yacc.c:1646 */ { yyPCB->Name = (yyvsp[-3].string); yyPCB->MaxWidth = NU ((yyvsp[-2].measure)); @@ -1950,7 +1950,7 @@ break; case 24: -#line 382 "parse_y.y" /* yacc.c:1646 */ +#line 384 "parse_y.y" /* yacc.c:1646 */ { yyPCB->Grid = OU ((yyvsp[-3].measure)); yyPCB->GridOffsetX = OU ((yyvsp[-2].measure)); @@ -1960,7 +1960,7 @@ break; case 25: -#line 390 "parse_y.y" /* yacc.c:1646 */ +#line 392 "parse_y.y" /* yacc.c:1646 */ { yyPCB->Grid = OU ((yyvsp[-4].measure)); yyPCB->GridOffsetX = OU ((yyvsp[-3].measure)); @@ -1976,7 +1976,7 @@ break; case 26: -#line 405 "parse_y.y" /* yacc.c:1646 */ +#line 407 "parse_y.y" /* yacc.c:1646 */ { yyPCB->Grid = NU ((yyvsp[-4].measure)); yyPCB->GridOffsetX = NU ((yyvsp[-3].measure)); @@ -1992,7 +1992,7 @@ break; case 27: -#line 439 "parse_y.y" /* yacc.c:1646 */ +#line 441 "parse_y.y" /* yacc.c:1646 */ { yyPCB->CursorX = OU ((yyvsp[-3].measure)); yyPCB->CursorY = OU ((yyvsp[-2].measure)); @@ -2002,7 +2002,7 @@ break; case 28: -#line 445 "parse_y.y" /* yacc.c:1646 */ +#line 447 "parse_y.y" /* yacc.c:1646 */ { yyPCB->CursorX = NU ((yyvsp[-3].measure)); yyPCB->CursorY = NU ((yyvsp[-2].measure)); @@ -2012,7 +2012,7 @@ break; case 31: -#line 469 "parse_y.y" /* yacc.c:1646 */ +#line 471 "parse_y.y" /* yacc.c:1646 */ { /* Read in cmil^2 for now; in future this should be a noop. */ yyPCB->IsleArea = PCB_MIL_TO_COORD (PCB_MIL_TO_COORD ((yyvsp[-1].number)) / 100.0) / 100.0; @@ -2021,7 +2021,7 @@ break; case 33: -#line 496 "parse_y.y" /* yacc.c:1646 */ +#line 498 "parse_y.y" /* yacc.c:1646 */ { yyPCB->ThermScale = (yyvsp[-1].number); } @@ -2029,7 +2029,7 @@ break; case 38: -#line 535 "parse_y.y" /* yacc.c:1646 */ +#line 537 "parse_y.y" /* yacc.c:1646 */ { yyPCB->Bloat = NU ((yyvsp[-3].measure)); yyPCB->Shrink = NU ((yyvsp[-2].measure)); @@ -2040,7 +2040,7 @@ break; case 39: -#line 545 "parse_y.y" /* yacc.c:1646 */ +#line 547 "parse_y.y" /* yacc.c:1646 */ { yyPCB->Bloat = NU ((yyvsp[-4].measure)); yyPCB->Shrink = NU ((yyvsp[-3].measure)); @@ -2052,7 +2052,7 @@ break; case 40: -#line 556 "parse_y.y" /* yacc.c:1646 */ +#line 558 "parse_y.y" /* yacc.c:1646 */ { yyPCB->Bloat = NU ((yyvsp[-6].measure)); yyPCB->Shrink = NU ((yyvsp[-5].measure)); @@ -2065,7 +2065,7 @@ break; case 41: -#line 583 "parse_y.y" /* yacc.c:1646 */ +#line 585 "parse_y.y" /* yacc.c:1646 */ { yy_pcb_flags = pcb_flag_make((yyvsp[-1].integer) & PCB_FLAGS); } @@ -2073,7 +2073,7 @@ break; case 42: -#line 587 "parse_y.y" /* yacc.c:1646 */ +#line 589 "parse_y.y" /* yacc.c:1646 */ { yy_pcb_flags = pcb_strflg_board_s2f((yyvsp[-1].string), yyerror); free((yyvsp[-1].string)); @@ -2082,7 +2082,7 @@ break; case 44: -#line 620 "parse_y.y" /* yacc.c:1646 */ +#line 622 "parse_y.y" /* yacc.c:1646 */ { layer_group_string = (yyvsp[-1].string); } @@ -2090,7 +2090,7 @@ break; case 46: -#line 668 "parse_y.y" /* yacc.c:1646 */ +#line 670 "parse_y.y" /* yacc.c:1646 */ { if (pcb_route_string_parse((yyvsp[-1].string), &yyPCB->RouteStyle, "mil")) { @@ -2103,7 +2103,7 @@ break; case 47: -#line 677 "parse_y.y" /* yacc.c:1646 */ +#line 679 "parse_y.y" /* yacc.c:1646 */ { if (pcb_route_string_parse(((yyvsp[-1].string) == NULL ? "" : (yyvsp[-1].string)), &yyPCB->RouteStyle, "cmil")) { @@ -2116,13 +2116,13 @@ break; case 54: -#line 700 "parse_y.y" /* yacc.c:1646 */ +#line 702 "parse_y.y" /* yacc.c:1646 */ { attr_list = & yyPCB->Attributes; } #line 2122 "parse_y.c" /* yacc.c:1646 */ break; case 58: -#line 704 "parse_y.y" /* yacc.c:1646 */ +#line 706 "parse_y.y" /* yacc.c:1646 */ { /* clear pointer to force memory allocation by * the appropriate subroutine @@ -2133,13 +2133,13 @@ break; case 60: -#line 711 "parse_y.y" /* yacc.c:1646 */ +#line 713 "parse_y.y" /* yacc.c:1646 */ { YYABORT; } #line 2139 "parse_y.c" /* yacc.c:1646 */ break; case 66: -#line 756 "parse_y.y" /* yacc.c:1646 */ +#line 758 "parse_y.y" /* yacc.c:1646 */ { pcb_via_new(yyData, NU ((yyvsp[-8].measure)), NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), (yyvsp[-2].string), (yyvsp[-1].flagtype)); @@ -2149,7 +2149,7 @@ break; case 67: -#line 766 "parse_y.y" /* yacc.c:1646 */ +#line 768 "parse_y.y" /* yacc.c:1646 */ { pcb_via_new(yyData, OU ((yyvsp[-8].measure)), OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer))); @@ -2159,7 +2159,7 @@ break; case 68: -#line 777 "parse_y.y" /* yacc.c:1646 */ +#line 779 "parse_y.y" /* yacc.c:1646 */ { pcb_via_new(yyData, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-5].measure)) + OU((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer))); @@ -2169,7 +2169,7 @@ break; case 69: -#line 787 "parse_y.y" /* yacc.c:1646 */ +#line 789 "parse_y.y" /* yacc.c:1646 */ { pcb_via_new(yyData, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), 2*PCB_GROUNDPLANEFRAME, OU((yyvsp[-4].measure)) + 2*PCB_MASKFRAME, OU ((yyvsp[-3].measure)), (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer))); @@ -2179,7 +2179,7 @@ break; case 70: -#line 797 "parse_y.y" /* yacc.c:1646 */ +#line 799 "parse_y.y" /* yacc.c:1646 */ { pcb_coord_t hole = (OU((yyvsp[-3].measure)) * PCB_DEFAULT_DRILLINGHOLE); @@ -2196,7 +2196,7 @@ break; case 71: -#line 833 "parse_y.y" /* yacc.c:1646 */ +#line 835 "parse_y.y" /* yacc.c:1646 */ { pcb_rat_new(yyData, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), (yyvsp[-5].integer), (yyvsp[-2].integer), conf_core.appearance.rat_thickness, (yyvsp[-1].flagtype)); @@ -2205,7 +2205,7 @@ break; case 72: -#line 838 "parse_y.y" /* yacc.c:1646 */ +#line 840 "parse_y.y" /* yacc.c:1646 */ { pcb_rat_new(yyData, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-5].integer), (yyvsp[-2].integer), conf_core.appearance.rat_thickness, pcb_flag_old((yyvsp[-1].integer))); @@ -2214,7 +2214,7 @@ break; case 73: -#line 869 "parse_y.y" /* yacc.c:1646 */ +#line 871 "parse_y.y" /* yacc.c:1646 */ { if ((yyvsp[-4].integer) <= 0 || (yyvsp[-4].integer) > PCB_MAX_LAYER) { @@ -2242,7 +2242,7 @@ break; case 85: -#line 914 "parse_y.y" /* yacc.c:1646 */ +#line 916 "parse_y.y" /* yacc.c:1646 */ { pcb_poly_new_from_rectangle(Layer, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-5].measure)) + OU ((yyvsp[-3].measure)), OU ((yyvsp[-4].measure)) + OU ((yyvsp[-2].measure)), pcb_flag_old((yyvsp[-1].integer))); @@ -2251,13 +2251,13 @@ break; case 89: -#line 921 "parse_y.y" /* yacc.c:1646 */ +#line 923 "parse_y.y" /* yacc.c:1646 */ { attr_list = & Layer->Attributes; } #line 2257 "parse_y.c" /* yacc.c:1646 */ break; case 92: -#line 953 "parse_y.y" /* yacc.c:1646 */ +#line 955 "parse_y.y" /* yacc.c:1646 */ { pcb_line_new(Layer, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), NU ((yyvsp[-2].measure)), (yyvsp[-1].flagtype)); @@ -2266,7 +2266,7 @@ break; case 93: -#line 962 "parse_y.y" /* yacc.c:1646 */ +#line 964 "parse_y.y" /* yacc.c:1646 */ { pcb_line_new(Layer, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), pcb_flag_old((yyvsp[-1].integer))); @@ -2275,7 +2275,7 @@ break; case 94: -#line 971 "parse_y.y" /* yacc.c:1646 */ +#line 973 "parse_y.y" /* yacc.c:1646 */ { /* eliminate old-style rat-lines */ if ((IV ((yyvsp[-1].measure)) & PCB_FLAG_RAT) == 0) @@ -2286,7 +2286,7 @@ break; case 95: -#line 1019 "parse_y.y" /* yacc.c:1646 */ +#line 1021 "parse_y.y" /* yacc.c:1646 */ { pcb_arc_new(Layer, NU ((yyvsp[-9].measure)), NU ((yyvsp[-8].measure)), NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), (yyvsp[-3].number), (yyvsp[-2].number), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-1].flagtype)); @@ -2295,7 +2295,7 @@ break; case 96: -#line 1028 "parse_y.y" /* yacc.c:1646 */ +#line 1030 "parse_y.y" /* yacc.c:1646 */ { pcb_arc_new(Layer, OU ((yyvsp[-9].measure)), OU ((yyvsp[-8].measure)), OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), (yyvsp[-3].number), (yyvsp[-2].number), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), pcb_flag_old((yyvsp[-1].integer))); @@ -2304,7 +2304,7 @@ break; case 97: -#line 1037 "parse_y.y" /* yacc.c:1646 */ +#line 1039 "parse_y.y" /* yacc.c:1646 */ { pcb_arc_new(Layer, OU ((yyvsp[-8].measure)), OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-6].measure)), IV ((yyvsp[-3].measure)), (yyvsp[-2].number), OU ((yyvsp[-4].measure)), 200*PCB_GROUNDPLANEFRAME, pcb_flag_old((yyvsp[-1].integer))); @@ -2313,7 +2313,7 @@ break; case 98: -#line 1074 "parse_y.y" /* yacc.c:1646 */ +#line 1076 "parse_y.y" /* yacc.c:1646 */ { /* use a default scale of 100% */ pcb_text_new(Layer,yyFont,OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].number), 100, (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer))); @@ -2323,7 +2323,7 @@ break; case 99: -#line 1084 "parse_y.y" /* yacc.c:1646 */ +#line 1086 "parse_y.y" /* yacc.c:1646 */ { if ((yyvsp[-1].integer) & PCB_FLAG_ONSILK) { @@ -2342,7 +2342,7 @@ break; case 100: -#line 1102 "parse_y.y" /* yacc.c:1646 */ +#line 1104 "parse_y.y" /* yacc.c:1646 */ { /* FIXME: shouldn't know about .f */ /* I don't think this matters because anything with hi_format @@ -2366,7 +2366,7 @@ break; case 101: -#line 1151 "parse_y.y" /* yacc.c:1646 */ +#line 1153 "parse_y.y" /* yacc.c:1646 */ { Polygon = pcb_poly_new(Layer, (yyvsp[-2].flagtype)); } @@ -2374,7 +2374,7 @@ break; case 102: -#line 1156 "parse_y.y" /* yacc.c:1646 */ +#line 1158 "parse_y.y" /* yacc.c:1646 */ { pcb_cardinal_t contour, contour_start, contour_end; pcb_bool bad_contour_found = pcb_false; @@ -2410,7 +2410,7 @@ break; case 105: -#line 1196 "parse_y.y" /* yacc.c:1646 */ +#line 1198 "parse_y.y" /* yacc.c:1646 */ { pcb_poly_hole_new(Polygon); } @@ -2418,7 +2418,7 @@ break; case 109: -#line 1210 "parse_y.y" /* yacc.c:1646 */ +#line 1212 "parse_y.y" /* yacc.c:1646 */ { pcb_poly_point_new(Polygon, OU ((yyvsp[-2].measure)), OU ((yyvsp[-1].measure))); } @@ -2426,7 +2426,7 @@ break; case 110: -#line 1214 "parse_y.y" /* yacc.c:1646 */ +#line 1216 "parse_y.y" /* yacc.c:1646 */ { pcb_poly_point_new(Polygon, NU ((yyvsp[-2].measure)), NU ((yyvsp[-1].measure))); } @@ -2434,7 +2434,7 @@ break; case 116: -#line 1285 "parse_y.y" /* yacc.c:1646 */ +#line 1287 "parse_y.y" /* yacc.c:1646 */ { yyElement = pcb_element_new(yyData, yyElement, yyFont, pcb_no_flags(), (yyvsp[-6].string), (yyvsp[-5].string), NULL, OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-2].integer), 100, pcb_no_flags(), pcb_false); @@ -2446,7 +2446,7 @@ break; case 117: -#line 1293 "parse_y.y" /* yacc.c:1646 */ +#line 1295 "parse_y.y" /* yacc.c:1646 */ { pcb_element_bbox(yyData, yyElement, yyFont); } @@ -2454,7 +2454,7 @@ break; case 118: -#line 1303 "parse_y.y" /* yacc.c:1646 */ +#line 1305 "parse_y.y" /* yacc.c:1646 */ { yyElement = pcb_element_new(yyData, yyElement, yyFont, pcb_flag_old((yyvsp[-9].integer)), (yyvsp[-8].string), (yyvsp[-7].string), NULL, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), IV ((yyvsp[-4].measure)), IV ((yyvsp[-3].measure)), pcb_flag_old((yyvsp[-2].integer)), pcb_false); @@ -2466,7 +2466,7 @@ break; case 119: -#line 1311 "parse_y.y" /* yacc.c:1646 */ +#line 1313 "parse_y.y" /* yacc.c:1646 */ { pcb_element_bbox(yyData, yyElement, yyFont); } @@ -2474,7 +2474,7 @@ break; case 120: -#line 1321 "parse_y.y" /* yacc.c:1646 */ +#line 1323 "parse_y.y" /* yacc.c:1646 */ { yyElement = pcb_element_new(yyData, yyElement, yyFont, pcb_flag_old((yyvsp[-10].integer)), (yyvsp[-9].string), (yyvsp[-8].string), (yyvsp[-7].string), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), IV ((yyvsp[-4].measure)), IV ((yyvsp[-3].measure)), pcb_flag_old((yyvsp[-2].integer)), pcb_false); @@ -2487,7 +2487,7 @@ break; case 121: -#line 1330 "parse_y.y" /* yacc.c:1646 */ +#line 1332 "parse_y.y" /* yacc.c:1646 */ { pcb_element_bbox(yyData, yyElement, yyFont); } @@ -2495,7 +2495,7 @@ break; case 122: -#line 1341 "parse_y.y" /* yacc.c:1646 */ +#line 1343 "parse_y.y" /* yacc.c:1646 */ { yyElement = pcb_element_new(yyData, yyElement, yyFont, pcb_flag_old((yyvsp[-12].integer)), (yyvsp[-11].string), (yyvsp[-10].string), (yyvsp[-9].string), OU ((yyvsp[-8].measure)) + OU ((yyvsp[-6].measure)), OU ((yyvsp[-7].measure)) + OU ((yyvsp[-5].measure)), @@ -2510,7 +2510,7 @@ break; case 123: -#line 1352 "parse_y.y" /* yacc.c:1646 */ +#line 1354 "parse_y.y" /* yacc.c:1646 */ { pcb_element_bbox(yyData, yyElement, yyFont); } @@ -2518,7 +2518,7 @@ break; case 124: -#line 1363 "parse_y.y" /* yacc.c:1646 */ +#line 1365 "parse_y.y" /* yacc.c:1646 */ { yyElement = pcb_element_new(yyData, yyElement, yyFont, (yyvsp[-12].flagtype), (yyvsp[-11].string), (yyvsp[-10].string), (yyvsp[-9].string), NU ((yyvsp[-8].measure)) + NU ((yyvsp[-6].measure)), NU ((yyvsp[-7].measure)) + NU ((yyvsp[-5].measure)), @@ -2533,7 +2533,7 @@ break; case 125: -#line 1374 "parse_y.y" /* yacc.c:1646 */ +#line 1376 "parse_y.y" /* yacc.c:1646 */ { pcb_element_bbox(yyData, yyElement, yyFont); } @@ -2541,7 +2541,7 @@ break; case 133: -#line 1454 "parse_y.y" /* yacc.c:1646 */ +#line 1456 "parse_y.y" /* yacc.c:1646 */ { pcb_element_line_new(yyElement, NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), NU ((yyvsp[-2].measure)), NU ((yyvsp[-1].measure))); } @@ -2549,7 +2549,7 @@ break; case 134: -#line 1459 "parse_y.y" /* yacc.c:1646 */ +#line 1461 "parse_y.y" /* yacc.c:1646 */ { pcb_element_line_new(yyElement, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), OU ((yyvsp[-1].measure))); } @@ -2557,7 +2557,7 @@ break; case 135: -#line 1464 "parse_y.y" /* yacc.c:1646 */ +#line 1466 "parse_y.y" /* yacc.c:1646 */ { pcb_element_arc_new(yyElement, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), NU ((yyvsp[-1].measure))); } @@ -2565,7 +2565,7 @@ break; case 136: -#line 1469 "parse_y.y" /* yacc.c:1646 */ +#line 1471 "parse_y.y" /* yacc.c:1646 */ { pcb_element_arc_new(yyElement, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), OU ((yyvsp[-1].measure))); } @@ -2573,7 +2573,7 @@ break; case 137: -#line 1474 "parse_y.y" /* yacc.c:1646 */ +#line 1476 "parse_y.y" /* yacc.c:1646 */ { yyElement->MarkX = NU ((yyvsp[-2].measure)); yyElement->MarkY = NU ((yyvsp[-1].measure)); @@ -2582,7 +2582,7 @@ break; case 138: -#line 1479 "parse_y.y" /* yacc.c:1646 */ +#line 1481 "parse_y.y" /* yacc.c:1646 */ { yyElement->MarkX = OU ((yyvsp[-2].measure)); yyElement->MarkY = OU ((yyvsp[-1].measure)); @@ -2591,13 +2591,13 @@ break; case 139: -#line 1483 "parse_y.y" /* yacc.c:1646 */ +#line 1485 "parse_y.y" /* yacc.c:1646 */ { attr_list = & yyElement->Attributes; } #line 2597 "parse_y.c" /* yacc.c:1646 */ break; case 147: -#line 1498 "parse_y.y" /* yacc.c:1646 */ +#line 1500 "parse_y.y" /* yacc.c:1646 */ { pcb_element_line_new(yyElement, NU ((yyvsp[-5].measure)) + yyElement->MarkX, NU ((yyvsp[-4].measure)) + yyElement->MarkY, NU ((yyvsp[-3].measure)) + yyElement->MarkX, @@ -2607,7 +2607,7 @@ break; case 148: -#line 1504 "parse_y.y" /* yacc.c:1646 */ +#line 1506 "parse_y.y" /* yacc.c:1646 */ { pcb_element_line_new(yyElement, OU ((yyvsp[-5].measure)) + yyElement->MarkX, OU ((yyvsp[-4].measure)) + yyElement->MarkY, OU ((yyvsp[-3].measure)) + yyElement->MarkX, @@ -2617,7 +2617,7 @@ break; case 149: -#line 1511 "parse_y.y" /* yacc.c:1646 */ +#line 1513 "parse_y.y" /* yacc.c:1646 */ { pcb_element_arc_new(yyElement, NU ((yyvsp[-7].measure)) + yyElement->MarkX, NU ((yyvsp[-6].measure)) + yyElement->MarkY, NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), NU ((yyvsp[-1].measure))); @@ -2626,7 +2626,7 @@ break; case 150: -#line 1516 "parse_y.y" /* yacc.c:1646 */ +#line 1518 "parse_y.y" /* yacc.c:1646 */ { pcb_element_arc_new(yyElement, OU ((yyvsp[-7].measure)) + yyElement->MarkX, OU ((yyvsp[-6].measure)) + yyElement->MarkY, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), OU ((yyvsp[-1].measure))); @@ -2635,13 +2635,13 @@ break; case 151: -#line 1520 "parse_y.y" /* yacc.c:1646 */ +#line 1522 "parse_y.y" /* yacc.c:1646 */ { attr_list = & yyElement->Attributes; } #line 2641 "parse_y.c" /* yacc.c:1646 */ break; case 153: -#line 1562 "parse_y.y" /* yacc.c:1646 */ +#line 1564 "parse_y.y" /* yacc.c:1646 */ { pcb_element_pin_new(yyElement, NU ((yyvsp[-9].measure)) + yyElement->MarkX, NU ((yyvsp[-8].measure)) + yyElement->MarkY, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-3].string), @@ -2653,7 +2653,7 @@ break; case 154: -#line 1574 "parse_y.y" /* yacc.c:1646 */ +#line 1576 "parse_y.y" /* yacc.c:1646 */ { pcb_element_pin_new(yyElement, OU ((yyvsp[-9].measure)) + yyElement->MarkX, OU ((yyvsp[-8].measure)) + yyElement->MarkY, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].string), @@ -2665,7 +2665,7 @@ break; case 155: -#line 1586 "parse_y.y" /* yacc.c:1646 */ +#line 1588 "parse_y.y" /* yacc.c:1646 */ { pcb_element_pin_new(yyElement, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), 2*PCB_GROUNDPLANEFRAME, OU ((yyvsp[-5].measure)) + 2*PCB_MASKFRAME, OU ((yyvsp[-4].measure)), (yyvsp[-3].string), (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer))); @@ -2676,7 +2676,7 @@ break; case 156: -#line 1597 "parse_y.y" /* yacc.c:1646 */ +#line 1599 "parse_y.y" /* yacc.c:1646 */ { char p_number[8]; @@ -2690,7 +2690,7 @@ break; case 157: -#line 1613 "parse_y.y" /* yacc.c:1646 */ +#line 1615 "parse_y.y" /* yacc.c:1646 */ { pcb_coord_t hole = OU ((yyvsp[-3].measure)) * PCB_DEFAULT_DRILLINGHOLE; char p_number[8]; @@ -2709,7 +2709,7 @@ break; case 158: -#line 1667 "parse_y.y" /* yacc.c:1646 */ +#line 1669 "parse_y.y" /* yacc.c:1646 */ { pcb_element_pad_new(yyElement, NU ((yyvsp[-10].measure)) + yyElement->MarkX, NU ((yyvsp[-9].measure)) + yyElement->MarkY, @@ -2723,7 +2723,7 @@ break; case 159: -#line 1681 "parse_y.y" /* yacc.c:1646 */ +#line 1683 "parse_y.y" /* yacc.c:1646 */ { pcb_element_pad_new(yyElement,OU ((yyvsp[-10].measure)) + yyElement->MarkX, OU ((yyvsp[-9].measure)) + yyElement->MarkY, OU ((yyvsp[-8].measure)) + yyElement->MarkX, @@ -2736,7 +2736,7 @@ break; case 160: -#line 1694 "parse_y.y" /* yacc.c:1646 */ +#line 1696 "parse_y.y" /* yacc.c:1646 */ { pcb_element_pad_new(yyElement,OU ((yyvsp[-8].measure)),OU ((yyvsp[-7].measure)),OU ((yyvsp[-6].measure)),OU ((yyvsp[-5].measure)),OU ((yyvsp[-4].measure)), 2*PCB_GROUNDPLANEFRAME, OU ((yyvsp[-4].measure)) + 2*PCB_MASKFRAME, (yyvsp[-3].string), (yyvsp[-2].string), pcb_flag_old((yyvsp[-1].integer))); @@ -2747,7 +2747,7 @@ break; case 161: -#line 1705 "parse_y.y" /* yacc.c:1646 */ +#line 1707 "parse_y.y" /* yacc.c:1646 */ { char p_number[8]; @@ -2760,19 +2760,19 @@ break; case 162: -#line 1715 "parse_y.y" /* yacc.c:1646 */ +#line 1717 "parse_y.y" /* yacc.c:1646 */ { (yyval.flagtype) = pcb_flag_old((yyvsp[0].integer)); } #line 2766 "parse_y.c" /* yacc.c:1646 */ break; case 163: -#line 1716 "parse_y.y" /* yacc.c:1646 */ +#line 1718 "parse_y.y" /* yacc.c:1646 */ { (yyval.flagtype) = pcb_strflg_s2f((yyvsp[0].string), yyerror); free((yyvsp[0].string)); } #line 2772 "parse_y.c" /* yacc.c:1646 */ break; case 167: -#line 1746 "parse_y.y" /* yacc.c:1646 */ +#line 1748 "parse_y.y" /* yacc.c:1646 */ { if ((yyvsp[-3].integer) <= 0 || (yyvsp[-3].integer) > PCB_MAX_FONTPOSITION) { @@ -2792,7 +2792,7 @@ break; case 168: -#line 1762 "parse_y.y" /* yacc.c:1646 */ +#line 1764 "parse_y.y" /* yacc.c:1646 */ { if ((yyvsp[-3].integer) <= 0 || (yyvsp[-3].integer) > PCB_MAX_FONTPOSITION) { @@ -2812,7 +2812,7 @@ break; case 174: -#line 1809 "parse_y.y" /* yacc.c:1646 */ +#line 1811 "parse_y.y" /* yacc.c:1646 */ { pcb_font_new_line_in_sym(Symbol, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), OU ((yyvsp[-1].measure))); } @@ -2820,7 +2820,7 @@ break; case 175: -#line 1816 "parse_y.y" /* yacc.c:1646 */ +#line 1818 "parse_y.y" /* yacc.c:1646 */ { pcb_font_new_line_in_sym(Symbol, NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), NU ((yyvsp[-2].measure)), NU ((yyvsp[-1].measure))); } @@ -2828,7 +2828,7 @@ break; case 183: -#line 1871 "parse_y.y" /* yacc.c:1646 */ +#line 1873 "parse_y.y" /* yacc.c:1646 */ { Menu = pcb_lib_net_new((pcb_lib_t *)&yyPCB->NetlistLib, (yyvsp[-3].string), (yyvsp[-2].string)); free ((yyvsp[-3].string)); @@ -2838,7 +2838,7 @@ break; case 189: -#line 1906 "parse_y.y" /* yacc.c:1646 */ +#line 1908 "parse_y.y" /* yacc.c:1646 */ { pcb_lib_conn_new(Menu, (yyvsp[-1].string)); free ((yyvsp[-1].string)); @@ -2847,25 +2847,25 @@ break; case 197: -#line 1953 "parse_y.y" /* yacc.c:1646 */ +#line 1955 "parse_y.y" /* yacc.c:1646 */ { pcb_ratspatch_append(yyPCB, RATP_ADD_CONN, (yyvsp[-2].string), (yyvsp[-1].string), NULL); free((yyvsp[-2].string)); free((yyvsp[-1].string)); } #line 2853 "parse_y.c" /* yacc.c:1646 */ break; case 198: -#line 1954 "parse_y.y" /* yacc.c:1646 */ +#line 1956 "parse_y.y" /* yacc.c:1646 */ { pcb_ratspatch_append(yyPCB, RATP_DEL_CONN, (yyvsp[-2].string), (yyvsp[-1].string), NULL); free((yyvsp[-2].string)); free((yyvsp[-1].string)); } #line 2859 "parse_y.c" /* yacc.c:1646 */ break; case 199: -#line 1955 "parse_y.y" /* yacc.c:1646 */ +#line 1957 "parse_y.y" /* yacc.c:1646 */ { pcb_ratspatch_append(yyPCB, RATP_CHANGE_ATTRIB, (yyvsp[-3].string), (yyvsp[-2].string), (yyvsp[-1].string)); free((yyvsp[-3].string)); free((yyvsp[-2].string)); free((yyvsp[-1].string)); } #line 2865 "parse_y.c" /* yacc.c:1646 */ break; case 200: -#line 1983 "parse_y.y" /* yacc.c:1646 */ +#line 1985 "parse_y.y" /* yacc.c:1646 */ { pcb_attribute_put(attr_list, (yyvsp[-2].string), (yyvsp[-1].string) ? (yyvsp[-1].string) : (char *)"", 0); free ((yyvsp[-2].string)); @@ -2875,85 +2875,85 @@ break; case 201: -#line 1990 "parse_y.y" /* yacc.c:1646 */ +#line 1992 "parse_y.y" /* yacc.c:1646 */ { (yyval.string) = (yyvsp[0].string); } #line 2881 "parse_y.c" /* yacc.c:1646 */ break; case 202: -#line 1991 "parse_y.y" /* yacc.c:1646 */ +#line 1993 "parse_y.y" /* yacc.c:1646 */ { (yyval.string) = 0; } #line 2887 "parse_y.c" /* yacc.c:1646 */ break; case 203: -#line 1995 "parse_y.y" /* yacc.c:1646 */ +#line 1997 "parse_y.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[0].number); } #line 2893 "parse_y.c" /* yacc.c:1646 */ break; case 204: -#line 1996 "parse_y.y" /* yacc.c:1646 */ +#line 1998 "parse_y.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[0].integer); } #line 2899 "parse_y.c" /* yacc.c:1646 */ break; case 205: -#line 2001 "parse_y.y" /* yacc.c:1646 */ +#line 2003 "parse_y.y" /* yacc.c:1646 */ { do_measure(&(yyval.measure), (yyvsp[0].number), PCB_MIL_TO_COORD ((yyvsp[0].number)) / 100.0, 0); } #line 2905 "parse_y.c" /* yacc.c:1646 */ break; case 206: -#line 2002 "parse_y.y" /* yacc.c:1646 */ +#line 2004 "parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), PCB_MIL_TO_COORD ((yyvsp[-1].number)) / 100000.0); } #line 2911 "parse_y.c" /* yacc.c:1646 */ break; case 207: -#line 2003 "parse_y.y" /* yacc.c:1646 */ +#line 2005 "parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), PCB_MIL_TO_COORD ((yyvsp[-1].number)) / 100.0); } #line 2917 "parse_y.c" /* yacc.c:1646 */ break; case 208: -#line 2004 "parse_y.y" /* yacc.c:1646 */ +#line 2006 "parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), PCB_MIL_TO_COORD ((yyvsp[-1].number))); } #line 2923 "parse_y.c" /* yacc.c:1646 */ break; case 209: -#line 2005 "parse_y.y" /* yacc.c:1646 */ +#line 2007 "parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), PCB_INCH_TO_COORD ((yyvsp[-1].number))); } #line 2929 "parse_y.c" /* yacc.c:1646 */ break; case 210: -#line 2006 "parse_y.y" /* yacc.c:1646 */ +#line 2008 "parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), PCB_MM_TO_COORD ((yyvsp[-1].number)) / 1000000.0); } #line 2935 "parse_y.c" /* yacc.c:1646 */ break; case 211: -#line 2007 "parse_y.y" /* yacc.c:1646 */ +#line 2009 "parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), PCB_MM_TO_COORD ((yyvsp[-1].number)) / 1000.0); } #line 2941 "parse_y.c" /* yacc.c:1646 */ break; case 212: -#line 2008 "parse_y.y" /* yacc.c:1646 */ +#line 2010 "parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), PCB_MM_TO_COORD ((yyvsp[-1].number))); } #line 2947 "parse_y.c" /* yacc.c:1646 */ break; case 213: -#line 2009 "parse_y.y" /* yacc.c:1646 */ +#line 2011 "parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), PCB_MM_TO_COORD ((yyvsp[-1].number)) * 1000.0); } #line 2953 "parse_y.c" /* yacc.c:1646 */ break; case 214: -#line 2010 "parse_y.y" /* yacc.c:1646 */ +#line 2012 "parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), PCB_MM_TO_COORD ((yyvsp[-1].number)) * 1000000.0); } #line 2959 "parse_y.c" /* yacc.c:1646 */ break; @@ -3187,7 +3187,7 @@ #endif return yyresult; } -#line 2013 "parse_y.y" /* yacc.c:1906 */ +#line 2015 "parse_y.y" /* yacc.c:1906 */ /* --------------------------------------------------------------------------- Index: trunk/src_plugins/io_pcb/parse_y.h =================================================================== --- trunk/src_plugins/io_pcb/parse_y.h (revision 7013) +++ trunk/src_plugins/io_pcb/parse_y.h (revision 7014) @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -98,10 +98,10 @@ /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - +typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 112 "parse_y.y" /* yacc.c:1909 */ +#line 113 "parse_y.y" /* yacc.c:1909 */ int integer; double number; @@ -111,8 +111,6 @@ #line 113 "parse_y.h" /* yacc.c:1909 */ }; - -typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 7013) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 7014) @@ -74,6 +74,7 @@ extern char *yyfilename; /* in this file */ extern conf_role_t yy_settings_dest; extern pcb_flag_t yy_pcb_flags; +extern int *yyFontkitValid; static char *layer_group_string; @@ -176,7 +177,8 @@ } for (i = 0; i < PCB_MAX_LAYER + 2; i++) LayerFlag[i] = pcb_false; - yyFont = &yyPCB->Font; + yyFont = &yyPCB->fontkit.dflt; + yyFontkitValid = &yyPCB->fontkit.valid; yyData = yyPCB->Data; yyData->pcb = yyPCB; yyData->LayerN = 0; @@ -266,7 +268,7 @@ pcb_message(PCB_MSG_ERROR, "illegal fileformat\n"); YYABORT; } - yyFont->Valid = pcb_false; + *yyFontkitValid = pcb_false; for (i = 0; i <= PCB_MAX_FONTPOSITION; i++) free (yyFont->Symbol[i].Line); memset(yyFont->Symbol, 0, sizeof(yyFont->Symbol)); @@ -273,7 +275,7 @@ } symbols { - yyFont->Valid = pcb_true; + *yyFontkitValid = pcb_true; pcb_font_set_info(yyFont); } ; Index: trunk/src_plugins/lib_gtk_common/dlg_propedit.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_propedit.c (revision 7013) +++ trunk/src_plugins/lib_gtk_common/dlg_propedit.c (revision 7014) @@ -353,7 +353,7 @@ PCB_MIL_TO_COORD(100), PCB_MIL_TO_COORD(100), 0.0, 90.0, PCB_MIL_TO_COORD(20), PCB_MIL_TO_COORD(20), pcb_flag_make(PCB_FLAG_CLEARLINE)); - pcb_text_new(preview_pcb.Data->Layer + 0, &PCB->Font, + pcb_text_new(preview_pcb.Data->Layer + 0, pcb_font(PCB, 0, 1), PCB_MIL_TO_COORD(850), PCB_MIL_TO_COORD(1150), 0, 100, "Text", pcb_flag_make(PCB_FLAG_CLEARLINE)); {