Closed Bug 121879 Opened 23 years ago Closed 19 years ago

Greek symbol "Pi" not printing correctly

Categories

(Core :: Print Preview, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: jfarrell, Unassigned)

References

()

Details

Attachments

(3 files)

From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
BuildID:    20020114

While running the Printing tests, I noticed that the output for the unicode.xml 
test did not print out the greek symbol for "Pi". It
displayed properly on the screen, but not when printed

Reproducible: Always
Steps to Reproduce:
1. follow the steps for:
http://www.mozilla.org/quality/browser/front-end/testcases/printing/XMLtest.html

specificaly the Unicode.xml test

Actual Results:  Printout does not look like screen display

Expected Results:  The 2 should look the same

I saw this on both OpenVMS and Linux; Could this be a problem with
the printer not knowing how to handle "Pi"?  I'm not sure. All I
see printed out is an empty square box instead of "pi".
Changes summary, since this I forgot to change it from the last bug I opened!
Sorry!!
Summary: Printout shows text ouside the "greyed" box → Greek symbol "Pi" not printing correctly
Confirming on Linux 2002012505 (0.9.8 branch). It doesn't show anything for the
Pi for me, print preview is ok though.
Attachment #66596 - Attachment description: http://mozilla.org/quality/browser/standards/xml/unicode.xml printed with 2002-01-25-05-0.9.8 branch → http://mozilla.org/quality/browser/standards/xml/unicode.xml printed with 2002-01-25-05-0.9.8 branch and PostScript module
-->
Assignee: rods → attinasi
Component: Printing → Print Preview
Target Milestone: --- → Future
Greek letter 'Pi' is printed with the following PS
command in the second attachment:

(\300\003) unicodeshow

And, it is to be rendered with default_ls which is defined as

/Unicode2NativeDictdef 0 dict def
/default_ls {
  /Unicode2NativeDict Unicode2NativeDictdef def
  /UCS2Font   /Courier def
  /NativeFont /Courier def
  /unicodeshow1 { real_glyph_unicodeshow } bind def
  /unicodeshow2 { real_unicodeshow_native } bind def
} bind def

Apparently, Courier is used to render Greek alphabets including
'Pi', but Courier doesn't have glyphs for Greek alphabets.
That's why you got blank square box in place of 'Pi'. 

If you look at 'unix.js' file, there are a bunch of entries
:

pref("print.psnativefont.ar", "");
pref("print.psnativefont.el", "");
pref("print.psnativefont.he", "");
pref("print.psnativefont.ja", "");
pref("print.psnativefont.ko", "");
pref("print.psnativefont.th", "");
pref("print.psnativefont.tr", "");
pref("print.psnativefont.x-baltic", "");
pref("print.psnativefont.x-central-euro", "");
pref("print.psnativefont.x-cyrillic", "");
pref("print.psnativefont.x-unicode", "");
pref("print.psnativefont.x-user-def", "");
pref("print.psnativefont.x-western", "");
pref("print.psnativefont.zh-CN", "");
pref("print.psnativefont.zh-TW", "");

However, Greek is not even listed there. Perhaps, adding
the following line may work:

pref("print.psnativefont.x-greek","Hershey-Greek-Complex")

Or, you may try adding the following lines to unixpsfonts.properties :

print.psnativefont.x-greek=Hershey-Greek-Complex
print.psnativecode.x-greek=iso8859-7

'Hershey-Greek-Complex' is a Greek type3 font that comes with
ghostscript. Actually, I don't know what encoding is used
in that font (whether it's iso8859-7 or somethign else).



BTW, I think the component this bug belongs to should be 
'Printing' instead of 'Printing preview'.
I guess this bug is not only about 'Pi' but about the whole
set of Greek alphabets. <http://gr.yahoo.com> cannot get printed
either. 
> Or, you may try adding the following lines to unixpsfonts.properties :

> print.psnativefont.x-greek=Hershey-Greek-Complex
> print.psnativecode.x-greek=iso8859-7

 The above two lines should read

  print.postscript.nativefont.el=Hershey-Greek-Complex
  print.postscript.nativecode.el=ISO-8859-7

> 'Hershey-Greek-Complex' is a Greek type3 font that comes with
> ghostscript. Actually, I don't know what encoding is used
> in that font (whether it's iso8859-7 or somethign else).

  As expected, Hershey-Greek-Complex has an encoding different
from ISO-8859-7 and adding two lines above doesn't help.
Frank,
What's the way to print Greek pages under Linux/Unix? 
This must have been enabled a long time ago. Otherwise,
Greek users would have complained loud, but......

BTW, could somebody add the keyword 'intl' to this bug? I don't
have enough privilige. 
Hi jshin,

I think this problem  has been fixed in bug 100328. Actually
yes, as you mentioned, if Times-Roman and Times-Bold
have greek glyphs, it should work.  "psnativefont" solution
actually does work only for CJK.

Do you think the following is reasonable ? We have 3
options now,

Option1: Modify PostScript Printer or GS
1. Replace PS font with Greek font
   e.g. Replace Times-Roman ... with Times-Roman-Greek
   so that Mozilla still use Times-Roman as PS font
2. Print on Mozilla

Option2: Modify outputs
1. Times-Roman-Greek should be in your PS printer or GS
2. Print on Mozilla with filter that does
    replace "Times-Roman" with "Times-Roman-Greek".

Option3: Use XPrint

And we will have option 4

Option4: Use FT2 - bug 90385 - Brian is currently working on that
Thank you for detailed and kind answers, Katakai-san,

> Option1: Modify PostScript Printer or GS
> 1. Replace PS font with Greek font
>   e.g. Replace Times-Roman ... with Times-Roman-Greek
>   so that Mozilla still use Times-Roman as PS font
>  2. Print on Mozilla

  It depends on how widely Times-Roman-Greek is available especially
for Linux users. Ghostscript 7.0.3 on my RH 7.1 doesn't have it.
Do Greek users have those fonts handy on their GS installation
or PS printers? How about Cyrillic? I don't have PS fonts
with both Latin and Cyrillic/Greek glyphs, but Russian users
have them. (see bug 100324)

> Option2: Modify outputs
> 1. Times-Roman-Greek should be in your PS printer or GS
> 2. Print on Mozilla with filter that does
>    replace "Times-Roman" with "Times-Roman-Greek".

  The same question applies here as above.

> Option3: Use XPrint

  I used to have some argument against using Xprint for general
Linux users with non-PS printers, but I can't remember what it was...
Ahah... perhaps one of them was that character repertoire was
limited to that of legacy character sets ...

> And we will have option 4

> Option4: Use FT2 - bug 90385 - Brian is currently working on that

  That will be nice, but it'll take a while. 

In the meantime, we need to know the answer to the question
about the availability of fonts (with Greek and Cyrillic glyphs
as well as Latin glyphs) on average 'home Unix-like OS' users.


BTW, one more question:

> "psnativefont" solution actually does work only for CJK.

print.postscript.nativefont.el

Is the line the above in unix.js  just a placeholder? 
http://packages.debian.org/unstable/x11/xfonts-greek-ph-scalable.html

Debian seems to have greek type1 fonts. Is that widely used?

> BTW, one more question:
> 
> > "psnativefont" solution actually does work only for CJK.
> 
> print.postscript.nativefont.el
> 
> Is the line the above in unix.js  just a placeholder? 

Oh, this seems to be my fault. If we set .el for preference,
this should work but currently does not because the codes
are converted to single byte. When I made a patch, I assumed
double bytes as native characters.

I have already made a patch in bug 82982. I tried just now
and verified it works. However, it also depends on font
availability on user system...

We will have one more option,

Option 5:

 set print.postscript.nativefont.el to your Greek fonts.

> Option 5:
>  set print.postscript.nativefont.el to your Greek fonts.

Thank you for info. on bug 82982 and a debian package for Greek type1 fonts. 

With your patch for bug 82982 applied and Greek type1 fonts (in ISO-8859-7
encoding) installed for my GS installation, I should be able to print
Greek pages with the following lines added to unix.js, right? 


print.postscript.nativefont.el=Debian-Greek-Font-Name
print.postscript.nativecode.el=ISO-8859-7

I'm sorry for digression, but .... how does Mozilla print out
UTF-8 pages with Cyrillic, Greek, Latin alphabets mixed? 
It doesn't seem like there's a glyph search routine in place
(as found in screen rendering) for printing. 


Hmmm. eventually
FT solution appears to be the way to go...


Hi Jshin,

> print.postscript.nativefont.el=Debian-Greek-Font-Name
> print.postscript.nativecode.el=ISO-8859-7

Yes, it should work. Actually I verified it works on my environment.

> I'm sorry for digression, but .... how does Mozilla print out
> UTF-8 pages with Cyrillic, Greek, Latin alphabets mixed? 
> It doesn't seem like there's a glyph search routine in place
> (as found in screen rendering) for printing. 

As I mentioned in bug 126604, if we could use UNICODE postscript
font, it should work. However, yes, it also depends on font
availability and there is not enough UNICODE postscript font
on platform.

We also could use "<span lang=...> tag for each language in
UTF-8 page. This also should work. But it's not reasonable...

> FT solution appears to be the way to go...

Yes, when we think UNICODE, FT solution can be the solution.



While browsing thru red book, I hit upon another stop-gap
solution : Mozilla might be able to use fonts with Adobe Symbol encoding
to print out some Greek alphabets. Symbol fonts are widely
available and using them will widen the coverage of glyphs
by mozilla PS printing. It may not help Greek users much
but it appears to help non-Greek users with some occasional
Greek alphabets mixed-in in their docs. 
jshin@mailaps.org wrote:
> > Option3: Use XPrint
>
> I used to have some argument against using Xprint for general
> Linux users with non-PS printers, but I can't remember what it was...
> Ahah... perhaps one of them was that character repertoire was
> limited to that of legacy character sets ...

Ugh.. ?!
What do you mean with this ?
Fact is that Xprint can print _any_ character/font which can be used on the
display Xserver. It either uses printer-buildin fonts, downloads PS Type1 fonts
to the print job or (as last option, if everything else fails) generates the
glyphs from the X11 fonts (again, this is the last option used).

The only disadvantage of Xprint is the lack of availability of a working Xprt
server on Linux, the Xfree86 version is completely broken and unuseable. But I
am working on a workaround by releasing a working Xprt binary for Linux x86
build from X11R6.5.1 sources next week.

> > And we will have option 4
> 
> > Option4: Use FT2 - bug 90385 - Brian is currently working on that
> 
>  That will be nice, but it'll take a while. 

Well, AFAIK the FT printing is only "GhostScript" printing, no "PostScript"
printing. FT printing will be useless for people with real postscript printers
until such printers would support the embedded TrueType fonts (AFAIK there are
no such products on the market nor are any annoucements (please correct me) for
such a support).
>> used to have some argument against using Xprint for general
>> Linux users with non-PS printers, but I can't remember what it was.
>> Ahah... perhaps one of them was that character repertoire was
>> limited to that of legacy character sets ...

> What do you mean with this ?
> Fact is that Xprint can print _any_ character/font which can be used > on the
display Xserver. It either uses printer-buildin fonts, 

  Does this mean that it can make use of CID-keyed fonts of any
encoding as well? If yes, my objection is nullified. 
  

> "PostScript"
>printing. FT printing will be useless for people with real postscript >
printers

  Not exactly. People with real postscript printers CAN install
ghostscript and pipe their printer jobs thru its psprint driver :-)
For CJK users, this has to be done anyway because PS printers
with resident CJK fonts are very rare (except for some Japanese
printers) while users can install CJK CID keyed fonts on their
ghostscript installation very easily. 
->default
Assignee: attinasi → printing
Blocks: 178822
is this now working?
should be fixed by my patch for bug 234182
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: