diff options
Diffstat (limited to 'pcl')
-rw-r--r-- | pcl/pcfsel.c | 24 | ||||
-rw-r--r-- | pcl/pcsymbol.c | 26 |
2 files changed, 44 insertions, 6 deletions
diff --git a/pcl/pcfsel.c b/pcl/pcfsel.c index 879720c9a..9f235c3b9 100644 --- a/pcl/pcfsel.c +++ b/pcl/pcfsel.c @@ -47,7 +47,7 @@ typedef enum { typedef int match_score_t[score_limit]; #ifdef DEBUG - +#include "plvalue.h" static const char * const score_name[] = { "symbol", "spacing", @@ -114,11 +114,23 @@ dprint_font_t(const pl_font_t *pfont) } static void -dprintf_font_scoring(const char *type, const pl_font_t *pfont, match_score_t score) +dprint_font_map(const pl_symbol_map_t *pmap) +{ + if (pmap != 0) + dprintf3("selected symbol set id:%d type:%d format:%s\n", pl_get_uint16(pmap->id), + pmap->type, (pmap->format == 1 ? "MSL" : "Unicode")); + else + dprintf("selected symbol set NULL\n"); + +} + +static void +dprintf_font_scoring(const char *type, const pl_font_t *pfont, pl_symbol_map_t *pmap, match_score_t score) { int i; dprintf1("%s: ", type); dprint_font_t(pfont); + dprint_font_map(pmap); dputs(" score:"); for ( i = 0; i < score_limit; ++i ) dprintf2(" %s: %d", score_name[i], score[i]); @@ -333,7 +345,7 @@ score_match(const pcl_state_t *pcs, const pcl_font_selection_t *pfs, #ifdef DEBUG if ( gs_debug_c('=') ) - dprintf_font_scoring("candidate", fp, score); + dprintf_font_scoring("candidate", fp, *mapp, score); #endif } @@ -402,7 +414,7 @@ pcl_reselect_font(pcl_font_selection_t *pfs, const pcl_state_t *pcs, bool intern #ifdef DEBUG if ( gs_debug_c('=') ) { if (best_match[0] != -1) /* skip sentinel */ - dprintf_font_scoring("best", best_font, best_match); + dprintf_font_scoring("best", best_font, mapp, best_match); } #endif for (i=(score_index_t)0; i<score_limit; i++) @@ -416,7 +428,7 @@ pcl_reselect_font(pcl_font_selection_t *pfs, const pcl_state_t *pcs, bool intern sizeof(match)); #ifdef DEBUG if ( gs_debug_c('=') ) { - dprintf_font_scoring("usurper", fp, best_match); + dprintf_font_scoring("usurper", fp, mapp, best_match); dprintf1(" better %s***)\n", score_name[i]); } @@ -430,7 +442,7 @@ pcl_reselect_font(pcl_font_selection_t *pfs, const pcl_state_t *pcs, bool intern return -1; /* no fonts */ #ifdef DEBUG if ( gs_debug_c('=') ) { - dprintf_font_scoring("champion", best_font, best_match); + dprintf_font_scoring("champion", best_font, mapp, best_match); } #endif diff --git a/pcl/pcsymbol.c b/pcl/pcsymbol.c index 67e437de3..c0645a946 100644 --- a/pcl/pcsymbol.c +++ b/pcl/pcsymbol.c @@ -28,6 +28,27 @@ pcl_symbol_set_id_code(pcl_args_t *pargs, pcl_state_t *pcs) return 0; } +#ifdef DEBUG +static void +dump_dl_symbol_set(pl_symbol_map_t *psm) +{ + dprintf6("header size:%d id:%d format:%s type:%d first code:%d last code:%d\n", + pl_get_uint16(psm->header_size), + pl_get_uint16(psm->id), + (psm->format == 1 ? "MSL" : (psm->format == 3 ? "Unicode" : "Unknown")), + psm->type, + pl_get_uint16(psm->first_code), + pl_get_uint16(psm->last_code)); + { + int i; + int num_codes = pl_get_uint16(psm->last_code) - pl_get_uint16(psm->first_code) + 1; + for (i = 0; i < num_codes; i++) { + dprintf2("index=%d, code:%d\n", i, psm->codes[i]); + } + } +} +#endif + static int /* ESC ( f <count> W */ pcl_define_symbol_set(pcl_args_t *pargs, pcl_state_t *pcs) { uint count = uint_arg(pargs); @@ -86,6 +107,11 @@ pcl_define_symbol_set(pcl_args_t *pargs, pcl_state_t *pcs) } #undef psm_header_size +#ifdef DEBUG + if ( gs_debug_c('=') ) + dump_dl_symbol_set(psm); +#endif + /* Symbol set may already exist; if so, we may be replacing one of * its existing maps or adding one for a new glyph vocabulary. */ if ( pl_dict_find(&pcs->soft_symbol_sets, id_key(pcs->symbol_set_id), |