Bug 690316 - Very large character not outlined correctly with UFST in ghostpcl
Summary: Very large character not outlined correctly with UFST in ghostpcl
Status: NOTIFIED FIXED
Alias: None
Product: GhostPCL
Classification: Unclassified
Component: PCL fonts (show other bugs)
Version: master
Hardware: PC Windows 2000
: P2 normal
Assignee: Henry Stiles
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-04 04:36 UTC by norbert.janssen
Modified: 2011-09-18 21:47 UTC (History)
0 users

See Also:
Customer: 661
Word Size: ---


Attachments
lpr2test.pcl (48 bytes, application/octet-stream)
2009-03-04 05:07 UTC, norbert.janssen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description norbert.janssen 2009-03-04 04:36:28 UTC
If printing attached testfile lpr2test.pcl on very high resolution (600dpi),
then the characters 'AB' are outlined i.s.o. rasterized. I.e.
image_outline_char()is used in pluchar.c
However, the points provided by UFST are mirrored with respect to Y direction,
resulting in a mirrored outline.
OLD code (line 196 in pluchar.c from trunk)
        while (numSegmts-- > 0) {
            int             segtype = *pseg++;
            int             ip, npts;
            gs_fixed_point  pt[3];

            if (segtype == 2 || segtype > 3)
                return_error(gs_error_rangecheck);

            npts = (segtype == 3 ? 3 : 1);
            for (ip = 0; ip < npts; ip++, ++pcoord) {
                pt[ip].x = (pcoord->x << ishift) + tx;
                pt[ip].y = (pcoord->y << ishift) + ty;
            }

fixed code:
        while (numSegmts-- > 0) {
            int             segtype = *pseg++;
            int             ip, npts;
            gs_fixed_point  pt[3];

            if (segtype == 2 || segtype > 3)
                return_error(gs_error_rangecheck);

            npts = (segtype == 3 ? 3 : 1);
            for (ip = 0; ip < npts; ip++, ++pcoord) {
                pt[ip].x = (pcoord->x << ishift) + tx;
                pt[ip].y = (-pcoord->y << ishift) + ty;
            }



Notice the '-' sign.        ^
Comment 1 norbert.janssen 2009-03-04 05:00:29 UTC
In order to switch to outline character for very large characters the test for
this is to be extended in pl_ufst_make_char()

        /* if too large for a bitmap, try an outline */
#if 1
        if ((status >= ERR_bm_gt_oron && status <= ERRdu_pix_range) ||
			(status == ERR_bm_buff))
#else
        if (status >= ERR_bm_gt_oron && status <= ERRdu_pix_range)
#endif
       	{
            pfc->format = (pfc->format & ~FC_BITMAP_TYPE) | FC_CUBIC_TYPE;
            if ((status = CGIFfont(FSA pfc)) == 0) {
                CGIFchIdptr(FSA (VOID *)&chIdloc, NULL);
                status = CGIFchar_handle(FSA chr, &memhdl, 0);
            }
        }
Comment 2 norbert.janssen 2009-03-04 05:07:35 UTC
Created attachment 4825 [details]
lpr2test.pcl

compile pcl with ufst (i.e. make udebug)

ufst-debugobj/pcl6 -sDEVICE=jpeg -r600 -sOutputFile=largechar.jpg lpr2test.pcl

in the resulting jpg-image the characters are vertically (y-direction)
mirrored.
NOTE: for this to work the ERR_bm_buff should be checked also in
pl_ufst_make_char()
Comment 3 Henry Stiles 2009-03-15 12:55:36 UTC
Is there some reason you did not concatenate the reflection on to the ctm? 
Other than that I'll go ahead and commit your changes.
Comment 4 norbert.janssen 2009-03-16 00:48:13 UTC
I agree that mirroring in the CTM is indeed a better solution. But I was not
sure how to do this, and if this would not interfere with other page grafics/text.
And this worked for me. Is is A solution not THE solution. ;)
Comment 5 Henry Stiles 2009-03-18 22:59:26 UTC
It looks like your solution is correct.  We are just pushing the coordinates
through assuming identity scaling with a translation, the low level path
operators gx_path* are used which assume coordinates have already been put in
device space.  I haven't looked at the ufst code in a while, so bear with me.  

I am somewhat alarmed this is broken.  I do recall it working years back, I
wonder if the ufst has changed.  Note the metrics in the outline case are
suspect, obviously the branch has not been exercised lately.

Thanks for the fix, it is in revision 9571.

Comment 6 Henry Stiles 2009-06-28 19:10:21 UTC
Woops, this change is not complete.  We note regressions in the pcl UFST
configuration, pcl 5e fts pages beginning with these panel numbers have errors:
0664, 0750, 0790, 1190, 1222 and a few others.  In all cases the characters are
rotated and should not be.
Comment 7 Henry Stiles 2009-06-29 13:57:20 UTC
Fixed in revision 9825.  We have tested the fts visually, our full regression
tests currently do not support the ufst font so let me know if you see any
problems.  I don't expect any problems, the change is straightforward.
 
Comment 8 Marcos H. Woehrmann 2011-09-18 21:47:52 UTC
Changing customer bugs that have been resolved more than a year ago to closed.