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

Re: ps-print with Meadow. (Re: ps-print.el and X-Face)



>>>>> meadow-users-jp の Mail No. 431 で、
>>>>> "市川" == Tatsuya Ichikawa <ichikawa@xxxxxxxxxxxxxx> さま曰く...

圭一> ;; おすすめできない理由がすぐにわかると思います。 ^_^;;;;
白井> 試させていただきました。これは、ちょっと……ですね。:-)

市川>   2ページ印刷すると結構見れます。(^^)

とりあえず、「ずれる」問題だけは文字間ピッチを変更する方法で回避できるよ
うにしました。Patch の中には font size を変える部分と白井さんの patch も
含まれていますので、前回流した「強引な方法」ははずしてしまってください。

また、 .emacs に次のものを追加してください。

(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)
        ))

;; gs5.50 のソースまで覗いて結構疲れたのと、チト本業が忙しくなっています
;; ので、とりあえずここまででしばらくはいじらないつもりです。

;;;; Akrさんが好んでいじるものだけあって PostScript というのは... ^^;;;;
-- 
鈴木圭一 / keiichi@xxxxxxxxxxxx, kei-suzu@xxxxxxxxxxxxxx
PGP finger print (DH/DSS) 796B B9B1 436B 481C 709B  430C 829F 1705 9BB2 CAF3

-------- 8>< -------- 8>< -------- 8>< -------- 8>< --------
*** ps-mule.el.orig	Fri Jan 08 19:37:16 1999
--- ps-mule.el	Fri Jan 08 19:27:47 1999
***************
*** 458,463 ****
--- 458,466 ----
  ;;	 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-cache (assoc (ps-mule-font-spec-name font-spec)
***************
*** 474,480 ****
  	 (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 font-name
  		   (if (eq ps-mule-current-charset 'ascii) "Ascii" ""))))
      (if font-cache
  	(setcar (cdr font-cache)
--- 477,489 ----
  	 (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 (cdr modifier))
! 		       ps-font-size))
! 		   font-name
  		   (if (eq ps-mule-current-charset 'ascii) "Ascii" ""))))
      (if font-cache
  	(setcar (cdr font-cache)
***************
*** 564,570 ****
  
  %% Define already scaled font for non-ASCII character sets.
  /DefFontMule {			% fontname size basefont  |-  --
!   findfont exch scalefont definefont pop
  } bind def
  
  %% Define already scaled font for ASCII character sets.
--- 573,583 ----
  
  %% Define already scaled font for non-ASCII character sets.
  /DefFontMule {			% fontname size basefont  |-  --
!   findfont exch scalefont
!   dup length dict begin {
!     1 index /FID ne {def} {pop pop} ifelse
!   } forall currentdict end
!   definefont pop
  } bind def
  
  %% Define already scaled font for ASCII character sets.
***************
*** 600,605 ****
--- 613,647 ----
  %% 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
  
  "
***************
*** 644,649 ****
--- 686,694 ----
  		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.
***************
*** 673,680 ****
  
       (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.
--- 718,734 ----
  
       (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 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.
-------- 8>< -------- 8>< -------- 8>< -------- 8>< --------