仲川@滋賀と申します。

自宅で、FreeBSD 5.2.1-RC2 を利用しています。

% uname -a 
FreeBSD zeus.my.domain 5.2.1-RC2 FreeBSD 5.2.1-RC2 #4: Sun Feb 22 02:22:40 JST
2004     root@zeus.my.domain:/usr/obj/usr/src/sys/INSPIRON  i386

日本語のテキストファイルを印刷したいのですが、ports でインストールした a2ps-j
の出力する postscript ファイルで、本文の部分が日本語になりません。

具体的には、下記の words-e.txt の内容を、

% a2ps-j words-e.txt > words-e.ps

としたとき、日本語の部分が、

bl ( ) s kanji_init (%9%L!<%W) ks nl
bl ( ) s
(%W%m%;%C%5B&$N%-%c%C%7%e!&%a%b%j$H%a%$%s!&%a%b%j$N4V$G@09g@-0];}!J%9%L!<%W!K)

のようになっています。これを印刷すると、上記の%の文字が入った本文が出力されま
す。

尚、コマンドで

% nkf -e words-e.txt | a2ps-j > words-e.ps 

とやってみても、同様でした。

LANGは、ja_JP.eucJP を指定しております。分かる方いらっしゃいましたら、教えて頂
けませんでしょうか?

(1)ファイルの内容(word-e.txt)
スヌープ
プロセッサ側のキャッシュ・メモリとメイン・メモリの間で整合性維持(スヌープ)

(2)生成された postscript ファイル

%!PS-Adobe-1.0
%%Title: words-e.txt
%%Creator: Id: a2ps,v 1.45 2001/05/28 07:25:46 utashiro Exp 
%%CreationDate: Sun Feb 22 21:16:55 2004
%%Pages: (atend)
%%PageOrder: Ascend
%%DocumentPaperSizes: A4
%%Orientation: Landscape
%%EndComments

/$a2psdict 100 dict def
$a2psdict begin
% Initialize page description variables.
/inch {72 mul} bind def
%% SelectTray
statusdict /a4tray known { statusdict begin a4tray end } if
/landscape true def
/twinpage true def
/sheetheight 11.64 inch def
/sheetwidth 8.27 inch def
/lmargin 1.2 inch def
/smargin 1.2 inch def
/paper_adjust 0.05 inch def
/noborder false def
/noheader false def
/headersize 0.22 inch def
/nofooter false def
/nopunchmark true def
/bodyfontsize 6.6 def
/kanjiAsciiRatio 1 def
/lines 66 def
/columns 86 def
/date (Feb 22 2004 21:16) def
/doasciimag false def
%!  PostScript Source Code
%
%  File: imag:/users/local/a2ps/header.ps
%  Created: Tue Nov 29 12:14:02 1988 by miguel@imag (Miguel Santana)
%  Version: 2.0
%  Description: PostScript prolog for a2ps ascii to PostScript program.
% 
%  Edit History:
%  - Original version by evan@csli (Evan Kirshenbaum).
%  - Modified by miguel@imag to:
%    1) Correct an overflow bug when printing page number 10 (operator
%       cvs).
%    2) Define two other variables (sheetwidth, sheetheight) describing
%       the physical page (by default A4 format).
%    3) Minor changes (reorganization, comments, etc).
%  - Modified by tullemans@apolloway.prl.philips.nl
%    1) Correct stack overflows with regard to operators cvs and copy.
%       The resulting substrings where in some cases not popped off 
%       the stack, what can result in a stack overflow.
%    2) Replaced copypage and erasepage by showpage. Page througput
%       degrades severely (see red book page 140) on our ps-printer
%       after printing sheet 16 (i.e. page 8) of a file which was 
%       actually bigger. For this purpose the definitions of startdoc
%       and startpage are changed.
%  - Modified by Tim Clark <T.Clark@uk.ac.warwick> to:
%    1) Print one page per sheet (portrait) as an option.
%    2) Reduce size of file name heading, if it's too big.
%    3) Save and restore PostScript state at begining/end. It now uses
%       conventional %%Page %%Trailer markers.
%    4) Print one wide page per sheet in landscape mode as an option.
%  - Modified by miguel@imag.fr to
%    1) Add new option to print n copies of a file.
%    2) Add new option to suppress heading printing.
%    3) Add new option to suppress page surrounding border printing.
%    4) Add new option to change font size. Number of lines and columns
%       are now automatically adjusted, depending on font size and
%       printing mode used.
%    5) Minor changes (best layout, usage message, etc).
%  - Modified by kanazawa@sra.co.jp to:
%    1) Handle Japanese code
%  - Modified by utashiro@sra.co.jp to:
%    1) Fix bug in printing long label
%    2) Handle carriage-return
%    3) Specify kanji-ascii character retio
%    4) Add footer label
%    5) Change filename->fname becuase ghostscript has operator filename
%    6) Support three different font style
%    7) Incorporate B4 paper support and punchmark contributed
%       by Masami Ueno <cabbage@kki.esi.yamanashi.ac.jp>
%

% Copyright (c) 1988, Miguel Santana, miguel@imag.imag.fr
%
% Permission is granted to copy and distribute this file in modified
% or unmodified form, for noncommercial use, provided (a) this copyright
% notice is preserved, (b) no attempt is made to restrict redistribution
% of this file, and (c) this file is not distributed as part of any
% collection whose redistribution is restricted by a compilation copyright.
%


% General macros.
/xdef {exch def} bind def
/getfont {exch findfont exch scalefont} bind def

% Page description variables and inch function are defined by a2ps program.

% Character size for differents fonts.
   landscape
   { /filenamefontsize 12 def }
   { /filenamefontsize 16 def }
ifelse
/datefontsize filenamefontsize 0.8 mul def
/headermargin filenamefontsize 0.25 mul def
/bodymargin bodyfontsize 0.7 mul def

% Font assignment to differents kinds of "objects"
/filenamefontname /Helvetica-Bold def
/stdfilenamefont filenamefontname filenamefontsize getfont def
/datefont /Helvetica datefontsize getfont def
/footerfont /Helvetica-Bold datefontsize getfont def
/mag { doasciimag { [ 1 0 0 asciimagsize 0 0 ] makefont } if } def
/bodynfont /Courier bodyfontsize getfont mag def
/bodybfont /Courier-Bold bodyfontsize getfont mag def
/bodyofont /Courier-BoldOblique bodyfontsize getfont mag def
/fontarray [ bodynfont bodybfont bodyofont ] def
/bodyfont bodynfont def

% Initializing kanji fonts
/kanji_initialized false def
/kanji_init {
   kanji_initialized not
   {
      /bodykfontsize bodyfontsize kanjiAsciiRatio mul def
      /bodyknfont /Ryumin-Light-H bodykfontsize getfont def
      /bodykbfont /GothicBBB-Medium-H bodykfontsize getfont def
      /bodykofont bodykbfont [ 1 0 .2 1 0 0 ] makefont def
      /KanjiRomanDiff 1.2 bodyfontsize mul 1.0 bodykfontsize mul sub def
      /KanjiRomanDiffHalf KanjiRomanDiff 2 div def
      /kfontarray [ bodyknfont bodykbfont bodykofont ] def
      /kanji_initialized true def
   } if
} def

% Backspace width
/backspacewidth
   bodyfont setfont (0) stringwidth pop
   def

% Logical page attributs (a half of a real page or sheet).
/pagewidth
   bodyfont setfont (0) stringwidth pop columns mul bodymargin dup add add
   def
/pageheight
   bodyfontsize 1.1 mul lines mul bodymargin dup add add headersize add
   def

% Coordinates for upper corner of a logical page and for sheet number.
% Coordinates depend on format mode used.
% In twinpage mode, coordinate x of upper corner is not the same for left
% and right pages: upperx is an array of two elements, indexed by sheetside.
/rightmargin smargin 3 div def
/leftmargin smargin 2 mul 3 div def
/topmargin lmargin twinpage {3} {2} ifelse div def
landscape
{  % Landscape format
   /punchx .4 inch def           % for PunchMark
   /punchy sheetwidth 2 div def  % for PunchMark
   /uppery rightmargin pageheight add bodymargin add def
   /sheetnumbery sheetwidth leftmargin pageheight add datefontsize add sub def
   twinpage
   {  % Two logical pages
      /upperx [ topmargin 2 mul                 % upperx for left page
                dup topmargin add pagewidth add % upperx for right page
              ] def
      /sheetnumberx sheetheight topmargin 2 mul sub def
   }
   {  /upperx [ topmargin dup ] def
      /sheetnumberx sheetheight topmargin sub datefontsize sub def
   }
   ifelse
}
{  % Portrait format
   /punchx .3 inch def
   /punchy sheetheight 2 div def
   /uppery topmargin pageheight add def
   /upperx [ leftmargin dup ] def
   /sheetnumberx sheetwidth rightmargin sub datefontsize sub def
   /sheetnumbery
         sheetheight 
         topmargin pageheight add datefontsize add headermargin add
      sub
      def
}
ifelse

% Strings used to make easy printing numbers
/pnum 12 string def
/empty 12 string def

% Other initializations.
datefont setfont
/datewidth date stringwidth pop def
/pagenumwidth (Page 999) stringwidth pop def
/filenameroom
         pagewidth
         filenamefontsize 4 mul datewidth add pagenumwidth add
      sub
   def


% Function startdoc: initializes printer and global variables.
/startdoc
    { /sheetside 0 def                  % sheet side that contains current page
   } bind def

% Function setlabel: initialize label in header
/setlabel
    { stdfilenamefont setfont
      /fname xdef
      /filenamewidth fname stringwidth pop def
      /filenamefont
         filenamewidth filenameroom gt
         {
               filenamefontname
               filenamefontsize filenameroom mul filenamewidth div
            getfont
         }
         {  stdfilenamefont }
         ifelse
         def
    } bind def

% Function printpage: Print a physical page.
/printpage
    { /sheetside 0 def
      twinpage
      {  sheetnumber }
      {  noheader noborder not and
            { sheetnumber }
         if
      }
      ifelse
      showpage 
%      pagesave restore
%      /sheet sheet 1 add def
    } bind def

% Function cleanup: terminates printing, flushing last page if necessary.
/cleanup
    { twinpage sheetside 1 eq and
         { printpage }
      if
    } bind def

%