I implemented pl_load_cartridge_fonts() (which scans the CART0 directory for Truetype fonts). When I set @PJL DEFAULT FONTSOURCE='C', then the pcl_set_current_font_environment() should first scan the pcs->cartridge_fonts for the default_fontnumber, and if not found is uses pjl_proc_set_next_fontsource() to go to the next fontsource (being 'I'). However, pjl_proc_set_next_fontsource() does not work (it results in a hangup). It starts in the current_fontsource ('C' == pst->font_envir[1] and iff there are fonts in 'CART0' then the pst->font_envir[current_source].fontnumber[0] != 0) so the current_source is not update to the next. I.e. there is no switch to the next fontsource. pjl_set_next_fontsource(pjl_parser_state_t* pst) { int current_source; pjl_envvar_t *current_font_source = pjl_get_envvar(pst, "fontsource"); /* find the index of the current resource then work backwards until we find font resources. We assume the internal source will have fonts */ for (current_source = 0; pst->font_envir[current_source].designator[0]; current_source++ ) if (!pjl_compare(pst->font_envir[current_source].designator, current_font_source)) break; /* next resource is not internal 'I' */ if ( current_source != 0 ) { while( current_source > 0 ) { /* valid font number found */ if ( pst->font_envir[current_source].fontnumber[0] ) break; current_source--; } } /* set both default and environment font source, the spec is not clear about this */ pjl_set(pst, (char *)"fontsource", pst->font_envir[current_source].designator, true); pjl_set(pst, (char *)"fontsource", pst->font_defaults[current_source].designator, false); } BETTER WORKING CODE: pjl_set_next_fontsource(pjl_parser_state_t* pst) { int current_source; pjl_envvar_t *current_font_source = pjl_get_envvar(pst, "fontsource"); /* find the index of the current resource then work backwards until we find font resources. We assume the internal source will have fonts */ for (current_source = 0; pst->font_envir[current_source].designator[0]; current_source++ ) if (!pjl_compare(pst->font_envir[current_source].designator, current_font_source)) break; /* next resource is not internal 'I' */ if ( current_source != 0 ) { while( current_source > 0 ) { current_source--; /* go to next fontsource */ /* check if it contains fonts, i.e. fontnumber != null */ if ( pst->font_envir[current_source].fontnumber[0] ) break; } } /* set both default and environment font source, the spec is not clear about this */ pjl_set(pst, (char *)"fontsource", pst->font_envir[current_source].designator, true); pjl_set(pst, (char *)"fontsource", pst->font_defaults[current_source].designator, false); }
revision 11298
Changing customer bugs that have been resolved more than a year ago to closed.