When printing attached testfile (metricstest.pcl) with PL_SCALER afs/ufst you see a difference in the metrics. AFS has the same metrics as HP LJ. UFST is too large. The problem is probably that the font used (Arial in UFST is not recognized as being a scaling_technology == plfst_TrueType in pctext.c::pcl_get_width() The fix is to add a check on a few specific typefaces, to be compatible with the HP LJ. static floatp pcl_get_width(pcl_state_t *pcs, gs_point *advance_vector, const gs_point *pscale, gs_char chr, bool is_space) { pcl_font_selection_t * pfp = &(pcs->font_selection[pcs->font_selected]); floatp width; if (chr != 0xffff) { if (!pfp->params.proportional_spacing || is_space) width = pcl_hmi(pcs); else { if ( pcs->font->scaling_technology == plfst_TrueType #ifdef HP_COMPATIBLE || ((pfp->params.typeface_family & 0x0fff) == 218 || /* Arial */ (pfp->params.typeface_family & 0x0fff) == 517 || /* Times New Roman */ (pfp->params.typeface_family & 0x0fff) == 302 || /* Symbol */ (pfp->params.typeface_family & 0x0fff) == 2730 /* Wingdings */ ) #endif ) { floatp tmp; tmp = pscale->x / (floatp)pcs->uom_cp + 0.5; tmp -= fmod(tmp, (floatp)1.0); tmp *= (floatp)pcs->uom_cp; width = advance_vector->x * tmp; } else width = advance_vector->x * pscale->x; width += (floatp)pcs->uom_cp / 2.0; width -= fmod(width, (floatp)pcs->uom_cp); } } else if (is_space) width = pcl_hmi(pcs); else width = 0.0; /* round to nearest integral pcl units */ return width; }
Created attachment 5175 [details] metrictest.pcl testfile to show difference in fontmetrics when printing with AFS or UFST
Was your test file extracted from a larger file that was a more complete metrics test, if so could you post the complete file?
Created attachment 5177 [details] metrictest.pcl all 79 PCL5 typefaces (no lineprinter). Note when printing with AFS that the Wingdings seems to be the same as the Dingbats.
Yes AFS does not include wingdings for legal reasons. Dingbats are substituted, I haven't looked at your complete metrics file yet but I suspect the fix should be as follows: Index: pctext.c =================================================================== --- pctext.c (revision 9827) +++ pctext.c (working copy) @@ -366,7 +366,8 @@ if (!pfp->params.proportional_spacing || is_space) width = pcl_hmi(pcs); else { - if ( pcs->font->scaling_technology == plfst_TrueType ) { + if (pcs->font->scaling_technology == plfst_TrueType || + pcs->font->scaling_technology == plfst_MicroType) { floatp tmp; tmp = pscale->x / (floatp)pcs->uom_cp + 0.5; tmp -= fmod(tmp, (floatp)1.0); Your change is more restrictive, I wonder if you have a counterexample to this patch.
Fixed in revision 9833. Please reopen if this doesn't address the issue.
Not for comparing AFS against UFST. This patch indeed makes the charactermetrics identical. However, for some of the typefaces/fonts there is a difference when comparing with an HP LJ4345 output.
HP devices differ, there is some discussion in the UFST documentation about advance width for different printers. Does Zoran match the LJ4345? If you could post a scan of the HP printer output, I'd be interested to see it.
As it is too large to post here, I sent it by email to Henry
Changing customer bugs that have been resolved more than a year ago to closed.