Bug 691098 - get_next_char maps '?' on 'space' when using UFST with lineprinter font
Summary: get_next_char maps '?' on 'space' when using UFST with lineprinter font
Status: NOTIFIED FIXED
Alias: None
Product: GhostPCL
Classification: Unclassified
Component: PCL fonts (show other bugs)
Version: master
Hardware: PC Windows XP
: P2 normal
Assignee: Henry Stiles
URL:
Keywords:
: 691097 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-02-01 02:24 UTC by norbert.janssen
Modified: 2010-02-01 23:54 UTC (History)
0 users

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


Attachments
lineprinter_questionmark.pcl (53 bytes, application/octet-stream)
2010-02-01 02:27 UTC, norbert.janssen
Details
lineprinter_questionmark.pcl (53 bytes, application/octet-stream)
2010-02-01 02:30 UTC, norbert.janssen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description norbert.janssen 2010-02-01 02:24:44 UTC
When compiling with the UFST fontrasterizer and printing attached testfile
(selecting lineprinter font) and printing the '?' character a ' ' (space) is
printed instead. When using AFS it is printed correctly.

Caused by this piece of code in pctext.c :: get_next_char()

    if (plfont->storage == pcds_internal && chr == 0x0020) {
        *pis_space = true;
        *pchr = 0xffff;
        return 0;
     }


Bug appeared with revision 10645 (change in pctext.c)

    /* check if the character is in the font and get the character
       width at the same time */

I.e. pl_map_symbol(...) returned (chr = 32)
the '?' has key=32 in the pl_map_m2u[] (With AFS the pl_map_symbol() skips the
pl_map_Unicode_to_MSL() because of is_MSL == 0 (with UFST is_MSL == 1).
pl_load_ufst_lineprinter() in plulfont.c sets the lineprinterfont to be MSL.
Comment 1 norbert.janssen 2010-02-01 02:27:13 UTC
Created attachment 5930 [details]
lineprinter_questionmark.pcl

testfile selecting lineprinterfont and printing the '?'

causes a ' ' (space) to be printed when using UFST i.s.o. AFS fontrasterizer.
Comment 2 norbert.janssen 2010-02-01 02:30:14 UTC
Created attachment 5931 [details]
lineprinter_questionmark.pcl

testfile selecting lineprinterfont and printing the '?'

causes a ' ' (space) to be printed when using UFST i.s.o. AFS fontrasterizer.
Comment 3 norbert.janssen 2010-02-01 02:36:12 UTC
Comment on attachment 5930 [details]
lineprinter_questionmark.pcl

I submitted the testfile twice :( I seem to have a very slow connection, so I
thought it failed.
Comment 4 norbert.janssen 2010-02-01 02:51:38 UTC
*** Bug 691097 has been marked as a duplicate of this bug. ***
Comment 5 norbert.janssen 2010-02-01 04:42:41 UTC
    if (plfont->storage == pcds_internal && chr == 0x0020
         && plfont->font_type != 10)	/* not for bitmapfonts */


The above fixed it for me , but you could also look for
plfont->params.typeface_family != 0 (i.e. lineprinter),
so I don't know what the best fix is.
Or perhaps re-order the characters in plulp.c in such a way that the space
character gets key=32 i.s.o. the '?' character. ???    
Comment 6 Henry Stiles 2010-02-01 09:48:44 UTC
Sorry I checked that in to minimize regression difference between the branch
pcl_font_mods and head.  I wasn't expecting someone to check out head and use
the ufst but I'll keep it (head) correct from here on out.
Comment 7 Henry Stiles 2010-02-01 22:20:18 UTC
Fixed 10686.  Thanks for the report Norbert.
Comment 8 norbert.janssen 2010-02-01 23:54:15 UTC
I was just 'pre-flighting' the coming 8.71 release, to see how the memory
consumption of the xps (excellent) is now (backporting that to 8.70 was too
risky/much work). And as we have also automated testing in place ...