Index: draw_fontsel.c =================================================================== --- draw_fontsel.c (revision 11456) +++ draw_fontsel.c (revision 11457) @@ -100,6 +100,7 @@ font_coord_t font_coord[MAX_FONT]; int font_coords; int font_new_y1, font_new_y2; +int font_replace_y1, font_replace_y2; int font_del_y1, font_del_y2; pcb_text_t *fontsel_txt = NULL; @@ -158,6 +159,14 @@ font_new_y1 = y; y += pcb_round(PCB_COORD_TO_MM(t->BoundingBox.Y2 - t->BoundingBox.Y1) + 0.5); font_new_y2 = y; + + /* Replace font */ + pcb_gui->set_color(gc, "#000000"); + t = dtext(5, y, 250, 0, "[Replace font]"); + pcb_text_bbox(pcb_font(PCB, 0, 1), t); + font_replace_y1 = y; + y += pcb_round(PCB_COORD_TO_MM(t->BoundingBox.Y2 - t->BoundingBox.Y1) + 0.5); + font_replace_y2 = y; /* Del font */ pcb_gui->set_color(gc, "#550000"); @@ -220,6 +229,12 @@ pcb_hid_actionl("LoadFontFrom", NULL); /* modal, blocking */ return 1; } + else if ((ymm >= font_replace_y1) && (ymm <= font_replace_y2)) { + char file[1] = "", id[5]; + pcb_snprintf(id, sizeof(id), "%ld", conf_core.design.text_font_id); + pcb_hid_actionl("LoadFontFrom", file, id, NULL); /* modal, blocking */ + return 1; + } else if ((ymm >= font_del_y1) && (ymm <= font_del_y2)) { if (conf_core.design.text_font_id == 0) { pcb_message(PCB_MSG_ERROR, "Can not remove the default font.\n");