Fail to print CJK page in Linux




19 years ago
19 years ago


(Reporter: teruko, Assigned: yueheng.xu)




Firefox Tracking Flags

(Not tracked)


(Whiteboard: [nsbeta2+], URL)



19 years ago
When you tried to print CJK page in Linux, the printer give you the

Steps of reproduce
1. Go to above URL
2. Select menu View|Print to send to printer

The paper prints out, but it prints the following error message.
"Error: /undefined in Unicodedict
 Operand stack:
 Execution stack:
    %interp_exit  .runexec2  --nostringval--  --nostringval--  --nostringval--
 Dictionary stack:
    --dict:776/809--  --dict:0/20  -dict:75/200--
 Current allocation mode is local
 Current file position is 104166  "

I am using Redhat Linux 6.0 + Japanese locale.  I tested printing in beta1
Linux build.  It printed as garbage, but it printed.  

The bug 30176 mentions "Fail to print Chinese webpages".  This bug is fixed,
but we do not have the right environment to test this.

Comment 1

19 years ago
This is not a bug, but a design API. The undefined /Unicodedict
is a PostScript font dictionary that the users must provide, to map to the
available fonts they have in your platform. If they do not have such a
environment, then they need a post processing utility to insert font
data into this PostScript file, and map the /Unicodedict to the font
data just inserted.

For example, if the page to be printed have used unicode U1111 and U2222,
you need 

<< U1111, localU1111
   U2222, localU2222

where localU1111, localU2222 are font rendering procedures in your local 
environemnt. This could be printer vendor specific.

If you do not have such an environement, then you need have a post-processing
utility to define and insert those local procedure in the PostScript file 
itself before it is printed. 

More documents are at


Comment 2

19 years ago
It is not acceptable to check in code that default to something most of the user
do not have. Please fix this. You should define a default /Unicodedict which
behave normally and let your post processing script to replace it to it's real
implementation. The bottom line is, if the users have install nothing else (no
post processing) and the CJK font is not avaiable on the printer, the page
should still be print and the English part and picture, <HR> should still print
normal while the CJK text may render as garbage or blank. Producing a postscript
error in the *default setting* is simply not a acceptable design.
Mark P1 blocker since this block any Linux print testing.

Assignee: ftang → yueheng.xu
Severity: normal → blocker
Keywords: beta2
Priority: P3 → P1

Comment 3

19 years ago
Putting on [nsbeta2+] radar.
Keywords: beta2 → nsbeta2
Whiteboard: [nsbeta2+]

Comment 4

19 years ago
A fix has been submitted for review. The default behavior now will print all
unicode with non-zero high-byte into a single chinese character "han" to 
indicate this is likely a CJK character and need CJK font support. To change
the default behavior, need define HAS_UNICODEDICT in nsPostScriptObj.cpp and
provide a post processing filter to supply /Unicodedict and font rendering 

Comment 5

19 years ago
I tested this in 2000042109 Linux build.  The page will sent to the printer, but
CJK characters are printed as one chinese character "Han".

Comment 6

19 years ago
does that make sense to also check in your post processing filter into mozilla ?

Comment 7

19 years ago
We need release note about how to set up the filter to get printing work.
Let the release note point to my document at

Right now, it works for my environment. Others need following steps to make it

0. have Mozilla Print to a file, such as

1. have my filter ttf2ps installed ( right now need resolve license mgmt 
   approval before check in).
2. have a TrueType font file installed at the same directory as above filter.
   If you have a user license of TurboLinux Chinese 4.0, get the file 
   htsong.ttf from there.
3. run my filter like this:
    ttf2ps >

4. Now send to a PostScript Printer, or to a ghoscript interpreter
   for final print out.

5. You may also modify my above steps to make it as a pipe command in the
   mozilla print menu. 

Target Milestone: --- → M17

Comment 8

19 years ago
I tested this in 2000-05-08 Linux build.  After I send the page to printer, 
"EROOR:undefinedresult: OFFENDING COMMAND: colorimage
STACK: 3 false {correntfile rowdata readhexstringpop} [10 0 0 1 0 0 ]
8 1 10" in the page.  Printing does not work even English page.

Comment 9

19 years ago

We should file a new bug about the colorimage problem.
It's not I18N issue.


I could not get your ttf2ps tool from the web site,
Could you tell me the exact point of the tool or
could you send the tool to me?

Comment 10

19 years ago
Katakai-san, I tested more in the different page.  I got the error in page.
I logged the different bug about that in bug 40604.

Comment 11

19 years ago
I just call yueheng.xu. He change his job and are no longer working on mozilla.
he said he will mail to mozilla-i18n his ttf2ps source code next week.

Comment 12

19 years ago
we should release note where can we find the filter and how to set it up. But 
for Mozilla, we should mark this bug fixed. 
Last Resolved: 19 years ago
Keywords: relnote
Resolution: --- → FIXED

Comment 13

19 years ago
This is fixed.
You need to log in before you can comment on or make changes to this bug.