[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: How to create or edit a multilingal text file.



※ "鈴" こと keiichi@xxxxxxxxx さんの
   『Re: How to create or edit a multilingal text file.』より

鈴> 多国語対応済 ps-print の ps-print-buffer を使えばたぶん印刷できると思い
鈴> ます。
鈴> http://www.mdcnet.co.jp/~keiichi/meadow-tips-ja.shtml をどうぞ。

ここには以前からお世話になっています。(_ _)

鈴> ちなみに Meadow 1.04a1 に付属の ps-print は元々、多国語対応のもののよう
鈴> です。

鈴> ;; 私の Windows 環境が以前クラッシュして以来、 gswin をインストールし直
鈴> ;; すのが面倒で試していないのですが、 Meadow 1.04a1 でもこの設定で使える
鈴> ;; のでしょうか? どなたか試しされた方はいらっしゃいませんか?

試しました...といってもちょっと設定が違うんですが、基本的に
OKだと思います。

違う点は、

・ps-do-despool()は書き換えずに、gs に直接出力させる
  -sOutputFile オプションで直接リモートのプリンタを指定しちゃっ
  てます。

・BDFフォントの設定はしていない
  普通の日本語テキストしか印刷しないと思うので設定していませ
  ん。

です。(と思います ^_^;)

私の設定は、

(setq ps-print-color-p t
      ps-lpr-command "d:/gstools/gs5.50/gswin32c.exe"
      ps-lpr-switches '("-q" "-dNOPAUSE" "-dBATCH"
                        "-sDEVICE=mswinpr2"
                        "-sOutputFile=\\\\Rnp63f3xx\\IPSIO_NX700"
                        "-ID:\\gstools\\gs5.50;[...]\\kanji")
      printer-name nil
      ps-printer-name nil
      ps-paper-type 'a4
      ps-multibyte-buffer 'non-latin-printer)

だけでいけてます。

これに鈴木さんの

| 国際化 ps-print を使用して印刷すると、 bitmap-mule で表示
| した X-Face にすきまが空いてしまい、日本語:ASCII が 2:1 の
| 比率にならないため、画面上のイメージとずれてしまいます。こ
| れを解消したい方は、このパッチをあて、上にあげた設定の 
| eval-after-load "ps-mule" 内の最後の部分につぎの設定を加え
| てください。

というパッチを ps-mule.el にあてて、

(eval-after-load "ps-mule"
  '(progn
     (setq ps-mule-font-size-modifier-alist '(("etl8x16-bitmap.bdf" . 1.2)))
     (setq ps-mule-charset-spacing-alist '((katakana-jisx0201 . 0.2)
                                           (latin-jisx0201 . 0.2)
                                           (japanese-jisx0208 . 0.2)))))

とすることでちゃんと2:1になりました。

Meadow-1.04 Alpha1 (TSUTSUJI) の ps-mule.el にはパッチがすな
おに当たりそうになかったので手で当てました。
一応最後に添付しておきます。

実は使っているプリンタは PS も理解してくれるネットワークプリ
ンタなんで lpr.exe を使って直接 PS ファイルを投げてもいいん
ですが、Windows のプリンタドライバの拡張機能(袋とじなど)が使
えるので、gswin32c 経由のほうがとっても嬉しかったりします。
-- 
6/29 17:46頃
NECソフトウェア新潟 水戸
mailto:mit@xxxxxxxxxxxxxxx ¥n
*** ps-mule.el	1999/06/29 07:51:16	1.1
--- ps-mule.el	1999/06/29 08:05:37
***************
*** 469,474 ****
--- 469,477 ----
  ;;	 cache CODE0 CODE1 ...)
  (defvar ps-mule-font-cache nil)
  
+ (defvar ps-mule-font-size-modifier-alist nil
+   "*Alist of font size modifier.")
+ 
  (defun ps-mule-generate-font (font-spec charset)
    "Generate PostScript codes to define a new font in FONT-SPEC for CHARSET."
    (let* ((font-name (ps-mule-font-spec-name font-spec))
***************
*** 485,491 ****
  	 (ps-output-prologue (funcall func charset font-spec)))
      (ps-output-prologue
       (list (format "/%s %f /%s Def%sFontMule\n"
! 		   scaled-font-name ps-font-size-internal font-name
  		   (if (eq ps-mule-current-charset 'ascii) "Ascii" ""))))
      (if font-cache
  	(setcar (cdr font-cache)
--- 488,500 ----
  	 (ps-output-prologue (funcall func charset font-spec)))
      (ps-output-prologue
       (list (format "/%s %f /%s Def%sFontMule\n"
! 		   scaled-font-name
! 		   (let ((modifier (assoc font-name 
! 					  ps-mule-font-size-modifier-alist)))
! 		     (if modifier
! 			 (* ps-font-size-internal (cdr modifier))
! 		       ps-font-size-internal))
! 		   font-name
  		   (if (eq ps-mule-current-charset 'ascii) "Ascii" ""))))
      (if font-cache
  	(setcar (cdr font-cache)
***************
*** 582,588 ****
  %% Define already scaled font for ASCII character sets.
  /DefAsciiFontMule {		% fontname size basefont  |-
    MuleDict begin
!   findfont dup /Encoding get /ISOLatin1Encoding exch def
    exch scalefont reencodeFontISO
    end
  } def
--- 591,601 ----
  %% Define already scaled font for ASCII character sets.
  /DefAsciiFontMule {		% fontname size basefont  |-
    MuleDict begin
!   findfont exch scalefont
!   dup length dict begin {
!     1 index /FID ne {def} {pop pop} ifelse
!   } forall currentdict end
!   definefont pop
    exch scalefont reencodeFontISO
    end
  } def
***************
*** 612,617 ****
--- 625,658 ----
  %% handler require it.
  /Cmpchar false def
  
+ % stack:  string  |-  --
+ % effect: 1  - underline  2   - strikeout  4  - overline
+ %         8  - shadow     16  - box        32 - outline
+ /AS {
+   /xx currentpoint dup Descent add /yy exch def
+   Ascent add /YY exch def def
+   dup stringwidth pop xx add /XX exch def
+   Effect 8 and 0 ne {
+     /yy yy Yshadow add def
+     /XX XX Xshadow add def
+   } if
+   bg {
+     true
+     Effect 16 and 0 ne
+       {SpaceBackground doBox}
+       {xx yy XX YY doRect}
+     ifelse
+   } if							% background
+   Effect 16 and 0 ne {false 0 doBox}if			% box
+   Effect 8  and 0 ne {dup doShadow}if			% shadow
+   Effect 32 and 0 ne
+     {true doOutline}					% outline
+     {0 exch ashow}					% normal text
+   ifelse
+   Effect 1  and 0 ne {UnderlinePosition Hline}if	% underline
+   Effect 2  and 0 ne {StrikeoutPosition Hline}if	% strikeout
+   Effect 4  and 0 ne {OverlinePosition  Hline}if	% overline
+ } bind def
  %%%% End of Mule Section
  
  "
***************
*** 656,661 ****
--- 697,705 ----
  		ps-width-remaining)
  	(cons to run-width)))))
  
+ (defvar ps-mule-charset-spacing-alist nil
+   "*Alist of charactar spacing which specified mule charsets.")
+ 
  ;;;###autoload
  (defun ps-mule-plot-string (from to &optional bg-color)
    "Generate PostScript code for ploting characters in the region FROM and TO.
***************
*** 685,692 ****
  
       (font-spec
        ;; We surely have a font for printing this character set.
!       (ps-output-string (ps-mule-string-encoding font-spec string))
!       (ps-output " S\n"))
  
       ((eq ps-mule-current-charset 'latin-iso8859-1)
        ;; Latin-1 can be printed by a normal ASCII font.
--- 729,745 ----
  
       (font-spec
        ;; We surely have a font for printing this character set.
!       (let ((spacing (cdr (assq ps-mule-current-charset
! 			       ps-mule-charset-spacing-alist)))
! 	    command)
! 	(setq string (ps-mule-string-encoding font-spec string))
! 	(if spacing
! 	    (progn
! 	      (ps-output (format "%f " (* ps-font-size-internal spacing)))
! 	      (setq command "AS"))
! 	  (setq command "S"))
! 	(ps-output-string string)
! 	(ps-output (format " %s\n" command))))
  
       ((eq ps-mule-current-charset 'latin-iso8859-1)
        ;; Latin-1 can be printed by a normal ASCII font.