Dear all,
We tried to print Chinese on notepad but failed. We found that WINE default only writes western characters to postscript. Is that true?
Here is the .ps we produced from notepad on WINE. We were trying to print a text of Chinese.
~~~~~~~~~~~~~~~~ %%% 7 args %!PS-Adobe-3.0 %%Creator: Wine PostScript Driver %%Title: 未命名 - 記事本 %%BoundingBox: 18 36 594 756 %%Pages: (atend) %%Orientation: Portrait %%EndComments %%BeginProlog /tmpmtrx matrix def /hatch { pathbbox /b exch def /r exch def /t exch def /l exch def /gap 32 def l cvi gap idiv gap mul gap r cvi gap idiv gap mul {t moveto 0 b t sub rlineto} for } bind def %%EndProlog %%BeginSetup mark { %%BeginFeature: *PageSize Letter <</PageSize[612 792]/ImagingBBox null>>setpagedevice %%EndFeature } stopped cleartomark %%EndSetup %%Page: 1 1 %%BeginPageSetup /pgsave save def 72 600 div 72 600 div scale 150 6300 translate 1 -1 scale 0 rotate %%EndPageSetup 0.00 setgray % /InnMing-Light-HKscs-B5-H findfont /AvantGarde-Book findfont [84 0 0 -84 0 0] 0 10 div matrix rotate matrix concatmatrix makefont setfont 457 132 moveto /space glyphshow /space glyphshow /space glyphshow /space glyphshow /space glyphshow /space glyphshow /yen glyphshow /onequarter glyphshow /copyright glyphshow /R glyphshow /brokenbar glyphshow /W glyphshow /space glyphshow /space glyphshow /space glyphshow /space glyphshow 0.00 setgray /AvantGarde-Book findfont [167 0 0 -167 0 0] 0 10 div matrix rotate matrix concatmatrix makefont setfont 457 667 moveto (This is a test. ) show
====================================== later we edit the .ps and add: /InnMing-Light-HKscs-B5-H findfont [167 0 0 -167 0 0] 0 10 div matrix rotate matrix concatmatrix makefont setfont (我們都是好朋友。) show ======================================
/AvantGarde-Book findfont [167 0 0 -167 0 0] 0 10 div matrix rotate matrix concatmatrix makefont setfont /threesuperior glyphshow /o glyphshow /logicalnot glyphshow /O glyphshow /currency glyphshow /at glyphshow /space glyphshow /Oacute glyphshow /guillemotleft glyphshow /D glyphshow /plusminus glyphshow /grave glyphshow /yen glyphshow /i glyphshow /periodcentered glyphshow /R glyphshow /ordfeminine glyphshow /ordmasculine glyphshow /ordfeminine glyphshow /F glyphshow /brokenbar glyphshow /egrave glyphshow /exclamdown glyphshow /C glyphshow /section glyphshow /Uacute glyphshow /currency glyphshow 0.00 setgray /AvantGarde-Book findfont [84 0 0 -84 0 0] 0 10 div matrix rotate matrix concatmatrix makefont setfont 457 5832 moveto /space glyphshow .... ~~~~~~~~~~~~~~~~~~~~~
I would like to ask if WINE will support multi-byte character printing?
Thanks very much. Leanne Tsang ThizLinux Laboratory Limited
leanne wrote:
We tried to print Chinese on notepad but failed. We found that WINE default only writes western characters to postscript. Is that true?
...
I would like to ask if WINE will support multi-byte character printing?
The PostScript driver itself has rudimentary support for the Unicode BMP (U+0000 - U+FFFF). It does not support multi-byte characters or wide characters.
You will need a TrueType font with the characters that you want to print (the driver can't handle non-Latin PostScript fonts), and you will have to configure the driver to use the font.
1. Tell the driver where to find the TrueType font by adding a [TrueType Font Directories] to your Wine configuration file. Something like this:
[TrueType Font Directories] "dir0" = "/usr/X11R6/lib/X11/fonts/TrueType" "dir1" = "/usr/share/fonts/default/TrueType"
2. Edit the PPD that you're using and add the TrueType font to the list of printer fonts. (You will need to know the Post- Script "FontName". You may need to run the font through a TrueType-to-PostScript converter to get this.)
At this point a Unicode-capable application should be able to print non- Western characters. There may, however, still be code between the application and the driver that does a Unicode-to-ASCII conversion, so there are no guarantees.
Note also that the PostScript driver will use the TrueType font, but it won't embed it in the output. If you're using Ghostscript, simply make sure that Ghostscript knows where to find the font and it will render it. If you're printing to a PostScript printer, you'll need to create a Type 42 version of the font and embed that in the job.
It's a lot harder than it should be.
Ian Pilcher wrote:
leanne wrote:
We tried to print Chinese on notepad but failed. We found that WINE default only writes western characters to postscript. Is that true?
...
I would like to ask if WINE will support multi-byte character printing?
The PostScript driver itself has rudimentary support for the Unicode BMP (U+0000 - U+FFFF). It does not support multi-byte characters or wide characters.
But U+0000 - U+FFFF contains almost all eastern characters. Last time I checked there were very little characters that needed two UTF-16 characters to be encoded, and they were mostly based around music notes and special symbols.
Ok, just rechecked. The following codes are outside the range:
* Byzantine Musical Symbols * Musical Symbols * Mathematical Alphanumeric Symbols * CJK Unified Ideographs Extension B <--- Would probably prove that my previous assesment was wrong. * CJK Compatibility Ideographs Supplement * Tags
And some private use sections.
Do the characters that render to the characters at http://www.unicode.org/charts/PDF/U3400.pdf print correctly for you? If so, then Ian's assesment is probably correct. If not, then there is probably another problem.
Shachar
On Wed, May 22, 2002 at 12:52:10PM +0800, leanne wrote:
Dear all,
We tried to print Chinese on notepad but failed. We found that WINE default only writes western characters to postscript. Is that true?
This doesn't solve your problem immediately but...
We've been working quite hard on making improvements to the PostScript driver and now have code that should print any character that can be displayed on the screen (assuming you're using client side font rendering anyway). The code downloads the TT font to the printer as either Type 42 (TT wrapped in PostScript) or for older printers the font gets converted to a Type 1 outline.
It needs a little more work before we submit it to winehq so please bear with us for a bit.
Huw.
Huw D M Davies wrote:
We've been working quite hard on making improvements to the PostScript driver and now have code that should print any character that can be displayed on the screen (assuming you're using client side font rendering anyway). The code downloads the TT font to the printer as either Type 42 (TT wrapped in PostScript) or for older printers the font gets converted to a Type 1 outline.
A couple of suggestions/requests:
1. A lot of Wine users (the majority?) will be printing to non- PostScript printers via Ghostscript. In this situation, embedding the TrueType font in the output is unnecessary, as long as the user has made Ghostscript aware of the font. Please enable the user to turn font embedding off.
2. Please don't disable the current (very kludgy) method of printing TrueType fonts. Client-side font rendering is definitely the way to go, but it currently causes Wine to crash on my system. Until client-side rendering stabilizes, I (and others) need to use X- based fonts but print TrueType fonts.
Sounds like very cool stuff!
On Wed, May 22, 2002 at 01:32:42PM -0500, Ian Pilcher wrote:
Huw D M Davies wrote:
We've been working quite hard on making improvements to the PostScript driver and now have code that should print any character that can be displayed on the screen (assuming you're using client side font rendering anyway). The code downloads the TT font to the printer as either Type 42 (TT wrapped in PostScript) or for older printers the font gets converted to a Type 1 outline.
A couple of suggestions/requests:
- A lot of Wine users (the majority?) will be printing to non- PostScript printers via Ghostscript. In this situation, embedding the TrueType font in the output is unnecessary, as long as the user has made Ghostscript aware of the font. Please enable the user to turn font embedding off.
I'm not sure how to neatly do this. I suppose the user could add the font to the ppd file and the font would then be treated as a builtin font.
The cost of download isn't too bad since you only download the glyphs that you use and not the whole font file.
- Please don't disable the current (very kludgy) method of printing TrueType fonts. Client-side font rendering is definitely the way to go, but it currently causes Wine to crash on my system. Until client-side rendering stabilizes, I (and others) need to use X- based fonts but print TrueType fonts.
Sounds like we need to fix the bug then. Could you open a bugzilla bug and include a +xrender,+font log?
Thanks, Huw.
Huw D M Davies wrote:
I'm not sure how to neatly do this. I suppose the user could add the font to the ppd file and the font would then be treated as a builtin font.
This is pretty much the "kludgy" method I was referring to below.
I would think that it would be pretty simple to have a per-printer setting to control this. (The default would, of course, be to do the embedding.) In fact, I can probably add this once your patch hits.
- Please don't disable the current (very kludgy) method of printing TrueType fonts. Client-side font rendering is definitely the way to go, but it currently causes Wine to crash on my system. Until client-side rendering stabilizes, I (and others) need to use X- based fonts but print TrueType fonts.
Sounds like we need to fix the bug then. Could you open a bugzilla bug and include a +xrender,+font log?
Of course, I can't reproduce the crash now. So I guess that you can consider this one "fixed".