/* Select font by ID (FI, FN). */ static int hpgl_select_font_by_id(hpgl_args_t * pargs, hpgl_state_t * pgls, int index) { pcl_font_selection_t *pfs = &pgls->g.font_selection[index]; int32 id; int code; if (!hpgl_arg_c_int(pgls->memory, pargs, &id) || id < 0) return e_Range; code = pcl_select_font_by_id(pfs, id, pgls /****** NOTA BENE ******/ ); switch (code) { default: /* error */ return code; case 1: /* ID not found, no effect */ return 0; case 0: /* ID found */ break; } pgls->g.font_selection[index].font = pfs->font; pgls->g.font_selection[index].map = pfs->map; /* * If we just selected a bitmap font, force the equivalent of SB1. * See TRM 23-65 and 23-81. */ if (pfs->font->scaling_technology == plfst_bitmap) { hpgl_args_t args; hpgl_args_setup(&args); hpgl_args_add_int(&args, 1); hpgl_SB(&args, pgls); } /* note pcltrm 23-54 - only select if the table (primary or secondary) matches the currently selected table. */ if (index == pgls->g.font_selected) { hpgl_select_font(pgls, index); } return 0; }
/* DF; sets programmable features except P1 and P2 */ int hpgl_DF(hpgl_args_t *pargs, hpgl_state_t *pgls) { hpgl_args_t args; hpgl_call(hpgl_reset_overlay(pgls)); hpgl_args_setup(&args); hpgl_FT(&args, pgls); hpgl_args_setup(&args); hpgl_IW(&args, pgls); hpgl_set_line_attribute_defaults(pgls); hpgl_args_setup(&args); hpgl_LA(&args, pgls); hpgl_set_line_pattern_defaults(pgls); hpgl_args_setup(&args); hpgl_RF(&args, pgls); hpgl_args_set_int(&args, 0); hpgl_SV(&args, pgls); hpgl_args_setup(&args); hpgl_UL(&args, pgls); hpgl_args_setup(&args); hpgl_SB(&args, pgls); return 0; }