The attached patch tries to enable printing using bdf-fonts. With
this patch I can print most languages from the hello-file. Can you
please check whether this patch makes sense and if yes include it into
the XEmacs packages?
According to the comment on top of
/usr/share/xemacs/xemacs-packages/lisp/ps-print/ps-mule.el
one can set
(setq ps-multibyte-buffer 'bdf-font)
and then bdf fonts will be embedded into the PostScript output.
This is rather ugly, but makes it possible to print (almost)
all languages shown on the hello page (M-x view-hello-file).
With GNU Emacs this works, but when I tried it with XEmacs it failed.
One reason is that ps-mule.el uses a few coding-systems which have
different names in XEmacs, I could solve that by defining aliases
like:
+(define-coding-system-alias 'greek-iso-8bit 'iso-8859-7)
+(define-coding-system-alias 'hebrew-iso-8bit 'iso-8859-8)
+(define-coding-system-alias 'cyrillic-iso-8bit 'iso-8859-5)
+(define-coding-system-alias 'vietnamese-viscii 'viscii)
+(define-coding-system-alias 'chinese-big5 'big5)
+(define-coding-system-alias 'thai-tis620 'tis-620)
Is this a correct solution?
Another problem is that 'coding-system-p' works differently on
XEmacs, which I could fix with:
- (cond ((coding-system-p encoding)
+ (cond ((if (string-match "XEmacs" emacs-version)
+ (find-coding-system encoding)
+ (coding-system-p encoding))
The third problem I found was that the variable
'enable-multibyte-characters' happened to be nil in ps-mule.el, which
also caused problems with multibyte printing.
The doc string of this variable says:
`enable-multibyte-characters' is a built-in boolean variable.
Value: t
Setting it would make its value buffer-local.
Documentation:
Emacs Compatible; Unimplemented
Non-nil means the buffer contents are regarded as multi-byte form
of characters, not a binary code. This affects the display, file I/O,
and behaviors of various editing commands.
Setting this to nil does not do anything.
If setting this to nil doesn't do anything, then I can just as well
assume that this is always t in ps-mule for XEmacs:
(and (boundp 'enable-multibyte-characters)
- enable-multibyte-characters
+ (if (string-match "XEmacs" emacs-version)
+ t
+ enable-multibyte-characters)
Apart from the hunks explained above the patch does some other trivial
things like changing the directory where the bdf fonts are:
- '("/usr/local/share/emacs/fonts/bdf"))
+ '("/usr/share/fonts/bdf"))
(that's where they are on SuSE Linux) and using gulim24.bdf instead
of hanglm24.bdf
(korean-ksc5601
- (normal bdf "hanglm24.bdf" ps-mule-encode-7bit 2))
+ (normal bdf "gulim24.bdf" ps-mule-encode-7bit 2))
because Korean users liked gulim24.bdf much better than hanglm24.bdf.
Using the attached patch and
(setq ps-multibyte-buffer 'bdf-font)
I was able to print all languages from the hello-file except Amharic,
Thai, and Tigrigna. When testing the bdf printing with the hello-file
you have to remove the lines with these languages, otherwise you will
get an error. I have no idea how to make it work for these languages
as well.
For testing the bdf printing you need the GNU intlfonts-1.2.
The following tarball contains them in bdf format and also
includes gulim24.bdf:
http://www.suse.de/~mfabian/misc/bdf-fonts.tar.bz2
--
Mike Fabian <mfabian(a)suse.de>
http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。