Bug 689584 - pswrite breaks Chinese characters
Summary: pswrite breaks Chinese characters
Status: IN_PROGRESS
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Writer (show other bugs)
Version: 8.60
Hardware: PC Linux
: P4 enhancement
Assignee: Ken Sharp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-29 18:19 UTC by William Bader
Modified: 2020-12-27 22:08 UTC (History)
4 users (show)

See Also:
Customer:
Word Size: ---


Attachments
sample eps file (436.19 KB, application/postscript)
2007-11-29 18:25 UTC, William Bader
Details
screen capture of generated and original file (117.62 KB, image/png)
2007-11-29 18:28 UTC, William Bader
Details

Note You need to log in before you can comment on or make changes to this bug.
Description William Bader 2007-11-29 18:19:43 UTC
I have a lot of Chinese files produced InDesign.  Each file is around 500 KB and
displays correctly with gs.  When I use a command like "gs -q -dBATCH -dNOPAUSE
-sDEVICE=pswrite -sOutputFile=x.ps 8240.eps", gs reduces the file to 10 KB, but
when I view the resulting file with gs, some lines are missing.  This might be
another symptom of bug 689525.  If I zoom into the file with gv, the missing
lines appear, but the fonts have been rasterized.  Using -r with large values
improves the appearance, but at the expense of making the file much larger.  Is
there a way to stop gs from rasterizing the fonts?  I am working on Linux on a
Pentium using gs 8.61.

Is there any way to reduce the size of this file?  I need to build a page with
about 200 of these files, and the page is getting very large.  pdfwrite produces
a 15 KB pdf, but xpdf's pdftops creates a 1500 KB ps (larger than the original
ps) and gs's pdf2ps produces a ps with the same problem as pswrite.
Comment 1 William Bader 2007-11-29 18:25:48 UTC
Created attachment 3588 [details]
sample eps file

This is a sample file with Chinese characters that shows the problem.  The file
looks OK, but if you process it with "gs -q -dBATCH -dNOPAUSE -sDEVICE=pswrite
-sOutputFile=x.ps 8240.eps" and view the result with gv, some letters are
missing parts at low zoom levels and the letters appear rasterized at high zoom
levels.
Comment 2 William Bader 2007-11-29 18:28:52 UTC
Created attachment 3589 [details]
screen capture of generated and original file

This screen capture shows the file generated by "gs -q -dBATCH -dNOPAUSE
-sDEVICE=pswrite -sOutputFile=x.ps 8240.eps" on the left and the original file
on the right.  I circled one of the characters in the main window that is
missing lines.	When I zoom 64X, the lines are there, but the character has
been rasterized.
Comment 3 Ray Johnston 2007-12-04 10:42:15 UTC
pswrite can't support CIDFont fonts so everything gets mapped to a bitmap font.
The quality can be improved somewhat by setting a higher resolution for pswrite,
but that makes the file even larger.

In theory ps2write _could_ convert to CIDFonts (as pdfwrite does), but this is
an enhancement. Currently ps2write also maps to bitmapped fonts.
Comment 4 Shailesh Mistry 2011-07-25 17:12:28 UTC
Enhancement still missing in Ghostscript 9.03
Comment 5 Ken Sharp 2017-03-06 09:41:31 UTC
We want to update ps2write so that it can handle CIDFonts (optionally) and as a starter in the direction of a ps3write (CIDFonts are a big part of what such a device would need).

Currently the pdfwrite device (which also handles ps2write and eps2write) can emit CIDFonts and CMaps into the body of a PDF file, so conceptually there is no great difficulty with getting these emitted in the PostScript output from ps2write, instead of rendering them to multiple type 3 bitmap fonts, as is currently done.

The challenge is to write PostScript code which will take the objects written as PDF objects by the pdfwrite code, and turn them into valid CID-keyed instances of CIDFonts, in a similar fashion to the way the regular font code in opdfread.ps turns the PDF font objects into PostScript fonts.

This needs to be switchable, just in case someone is running on a version of PostScript prior to version 2015 when CIDFont support was added. Note that we already have a control 'HaveCIDSystem' but I don't think it currently does anything useful, I certainly don;t think it works.
Comment 6 Peter Cherepanov 2020-12-27 22:08:52 UTC
Ghostscript still rasterizes this sample file on ps2write device; pdfwrite device produces vector output.