prov-1.x系では、内部処理のエンコーディングをEUC-JPで行っていたのを、 prov-2.x系ではUTF-8に変更しました。これにより、PUA(Private Use Area = いわゆる外字)を含むUnicode範囲のフォントを利用して帳票を作成出来る ようになりました。
prov2 -text mesh.ov README.jp | lpr -Pps-printer or cat README.jp | prov2 -text mesh.ov - | lpr -Pps-printer上記の操作で、README.jp(テキストファイル)
| 
prov-2.1 -- print overlay utilities
Copyright (C) 2003  Masahiko Ito
These programs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
These programs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with these programs; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
Mail suggestions and bug reports for these programs to
m-ito@myh.no-ip.org
prov2とは何か?
=============
  UNIX系システム上で利用できるフォームオーバレイ印字ツールです。
前提条件
========
  postscript形式ファイルを印字できる環境が既に構築されていること。
インストール
============
  o Makefileを編集しPROV2DIRマクロにインストール先ディレクトリをセット
    します。デフォルトのインストールディレクトリは~/prov2です。
  o make
  o make install
  o ~/.profile等を編集してPROV2DIR環境変数にインストール先ディレクトリを
    セットする。
  o ~/.profile等を編集してPATH環境変数に${PROV2DIR}/binを追加する。
サンプル印字(1)
===============
  prov2 -text mesh.ov README.jp | lpr -Pps-printer
  or
  cat README.jp | prov2 -text mesh.ov - | lpr -Pps-printer
  上記の操作で、README.jp(この文書)にmesh.ov(網掛けオーバレイ)を重ねて
  ps-printerから印字します。(いわゆる)半角文字のデフォルトは12point、
  全角文字のデフォルトも12pointになります。それぞれは、環境変数
  PROV2_ANKPOINT、PROV2_KANJIPOINT で変更できます。但しその際は、${PROV2DIR}/etc/a4v.ps
  内のパラメータ(SYS_Char, SYS_Line, SYS_Xbias, SYS_Ybias, SYS_MaxWidth,
  SYS_MaxHeight etc...)の調整が必要になるでしょう。
サンプル印字(2)
===============
  prov2 -csv table.ov member.def member.dat | lpr -Pps-printer
  or
  cat member.dat | prov2 -csv table.ov member.def - | lpr -Pps-printer
  上記の操作で、member.dat(csv形式データファイル)をmember.def(フォーマット
  定義ファイル)の定義に従ってフォーマットし、table.ov(テーブルオーバレイ定義)
  を重ねてps-printerから印字します。
印字調整
========
  印字調整を${PROV2DIR}/etc/a4v.ps内の定義を編集する事で行えます。
% start user definition
%------------------------------------------------------------------
% < X unit length (point) >
%
 | 
| 
%
% overlay mesh on A4, portrait paper
%
% set mesh gray scale
%
.8 setGrayScale
%
% set 0 to OV_LINE
%
/OV_LINE 0 def
%
% repeat 33 times { ... }
%
33 {
%
% overlay mesh on (0,OV_LINE)-(80,OV_LINE+1) rectangle
%
    0 OV_LINE 80 OV_LINE 1 add fillBox
%
% down mesh to 2 line
%
    OV_LINE 2 add
%
% set OV_LINE
%
    /OV_LINE exch def
} repeat
%
% reset gray scale
%
0 setGrayScale
%
%
%
 | 
| 
%!
% start user definition
%
% < X unit length (point) >
%
/SYS_Char {72.00 10 div} def
%
% < Y unit length (point) >
%
/SYS_Line {72.00  6 div} def
%
% < X bias (Char) >
%
/SYS_Xbias {2 SYS_Char mul} def
%
% < Y bias (Line) >
%
/SYS_Ybias {-2 SYS_Line mul} def
%
% < max printable width (Char) >
%
/SYS_MaxWidth 80 def
%
% < max printable height (Line) >
%
/SYS_MaxHeight 66 def
%
% end user definition
%
%----------------------------------------------------------------------
%
% start system definition
%
% CHAR c2p ... convert Char to point
%
/c2p {
    /SYS_c2p_CHAR_X exch def
    SYS_c2p_CHAR_X SYS_Char mul
    SYS_Xbias add
} def
%
% LINE l2p ... convert Line to point
%
/l2p {
    /SYS_l2p_LINE_Y exch def
    SYS_MaxHeight SYS_Line mul
    SYS_Ybias sub
    SYS_l2p_LINE_Y SYS_Line mul
    sub
} def
%
% DASH setLineStyle (DASH is 0 or 1 or ... )
%
/setLineStyle {
    /SYS_setLineStyle_DASH exch def
    0 SYS_setLineStyle_DASH eq {[] 0 setdash}
                               {[SYS_setLineStyle_DASH] 0 setdash} ifelse
} def
%
% GRAY setGrayScale (GRAY is 0 to 1)
%
/setGrayScale {
    setgray
} def
%
% X0 Y0 X1 Y1 WIDTH drawLine
%
/drawLine {
    /SYS_drawLine_WIDTH  exch def
    /SYS_drawLine_Y1     exch def
    /SYS_drawLine_X1     exch def
    /SYS_drawLine_Y0     exch def
    /SYS_drawLine_X0     exch def
    newpath
    SYS_drawLine_WIDTH setlinewidth
    SYS_drawLine_X0 c2p SYS_drawLine_Y0 l2p moveto
    SYS_drawLine_X1 c2p SYS_drawLine_Y1 l2p lineto
    stroke
} def
%
% X0 Y0 X1 Y1 WIDTH XDELTA YDELTA REPEAT drawRepeatLine
%
/drawRepeatLine {
    /SYS_drawRepeatLine_REPEAT exch def
    /SYS_drawRepeatLine_YDELTA exch def
    /SYS_drawRepeatLine_XDELTA exch def
    /SYS_drawRepeatLine_WIDTH  exch def
    /SYS_drawRepeatLine_Y1     exch def
    /SYS_drawRepeatLine_X1     exch def
    /SYS_drawRepeatLine_Y0     exch def
    /SYS_drawRepeatLine_X0     exch def
    SYS_drawRepeatLine_REPEAT {
        SYS_drawRepeatLine_X0 SYS_drawRepeatLine_Y0
        SYS_drawRepeatLine_X1 SYS_drawRepeatLine_Y1 
        SYS_drawRepeatLine_WIDTH drawLine
        SYS_drawRepeatLine_X0 SYS_drawRepeatLine_XDELTA add
        /SYS_drawRepeatLine_X0 exch def
        SYS_drawRepeatLine_Y0 SYS_drawRepeatLine_YDELTA add
        /SYS_drawRepeatLine_Y0 exch def
        SYS_drawRepeatLine_X1 SYS_drawRepeatLine_XDELTA add
        /SYS_drawRepeatLine_X1 exch def
        SYS_drawRepeatLine_Y1 SYS_drawRepeatLine_YDELTA add
        /SYS_drawRepeatLine_Y1 exch def
    } repeat
} def
%
% X0 Y0 X1 Y1 WIDTH drawBox
%
/drawBox {
    /SYS_drawBox_WIDTH exch def
    /SYS_drawBox_Y1 exch def
    /SYS_drawBox_X1 exch def
    /SYS_drawBox_Y0 exch def
    /SYS_drawBox_X0 exch def
    SYS_drawBox_X0 SYS_drawBox_Y0 SYS_drawBox_X0 SYS_drawBox_Y1
    SYS_drawBox_WIDTH drawLine
    SYS_drawBox_X0 SYS_drawBox_Y1 SYS_drawBox_X1 SYS_drawBox_Y1 
    SYS_drawBox_WIDTH drawLine
    SYS_drawBox_X1 SYS_drawBox_Y1 SYS_drawBox_X1 SYS_drawBox_Y0 
    SYS_drawBox_WIDTH drawLine
    SYS_drawBox_X1 SYS_drawBox_Y0 SYS_drawBox_X0 SYS_drawBox_Y0 
    SYS_drawBox_WIDTH drawLine
} def 
%
% X0 Y0 X1 Y1 fillBox
%
/fillBox {
    /SYS_fillBox_Y1 exch def
    /SYS_fillBox_X1 exch def
    /SYS_fillBox_Y0 exch def
    /SYS_fillBox_X0 exch def
    newpath
    SYS_fillBox_X0 c2p SYS_fillBox_Y0 l2p moveto
    SYS_fillBox_X0 c2p SYS_fillBox_Y1 l2p lineto
    SYS_fillBox_X1 c2p SYS_fillBox_Y1 l2p lineto
    SYS_fillBox_X1 c2p SYS_fillBox_Y0 l2p lineto
    closepath
    fill
} def
%
% POINT FONT setChar
%
/FONT_NORMAL     0 def
/FONT_ITALIC     1 def
/FONT_BOLD       2 def
/FONT_BOLDITALIC 3 def
%
/setChar {
    /SYS_setChar_FONT exch def
    /SYS_setChar_POINT exch def
    SYS_setChar_FONT FONT_NORMAL eq {/Courier findfont} if
    SYS_setChar_FONT FONT_ITALIC eq {/Courier_Italic findfont} if
    SYS_setChar_FONT FONT_BOLD eq {/Courier_Bold findfont} if
    SYS_setChar_FONT FONT_BOLDITALIC eq {/Courier_BoldItalic findfont} if
    SYS_setChar_POINT scalefont
    setfont
} def 
%
% POINT KFONT setKanjiChar
%
/KFONT_RYUMIN   0 def
/KFONT_RYUMIN_V 1 def
/KFONT_GOTHIC   2 def
/KFONT_GOTHIC_V 3 def
%
/setKanjiChar {
    /SYS_setKanjiChar_KFONT exch def
    /SYS_setKanjiChar_POINT exch def
    SYS_setKanjiChar_KFONT KFONT_RYUMIN eq {/Ryumin-Light-H findfont} if
    SYS_setKanjiChar_KFONT KFONT_RYUMIN_V eq {/Ryumin-Light-V findfont} if
    SYS_setKanjiChar_KFONT KFONT_GOTHIC eq {/GothicBBB-Medium-H findfont} if
    SYS_setKanjiChar_KFONT KFONT_GOTHIC_V eq {/GothicBBB-Medium-V findfont} if
    SYS_setKanjiChar_POINT scalefont
    setfont
} def 
%
% X Y (TEXT) drawText
% X Y  | 
|  | 
(いわゆる)半角文字のデフォルトは12point、
全角文字のデフォルトも12pointになりますが、このまま印字すると全角1文字
の幅が半角2文字の幅より若干短くなるので、ギャップを2.4point入れています。
※ Courierフォント(半角)は縦12pointの場合、横7.2pointです。Ryumin(全角)は縦12pointの場合、横も12pointです。
デフォルトのポイント数、ギャップは環境変数で変更できます。
prov2 -csv table.ov member.def member.dat | lpr -Pps-printer or cat member.dat | prov2 -csv table.ov member.def - | lpr -Pps-printer上記の操作で、member.dat(csv形式データファイル)
| 0001 佐藤 克己 男 1922.06.26 日本 大阪 0002 木下 清志 男 1922.09.03 日本 兵庫 0003 坂本 雅治 男 1924.10.23 日本 京都 0004 澤田 雅彦 男 1927.01.22 日本 大阪 0005 伊藤 雅夫 男 1965.01.08 日本 大阪 | 
| 1 1 10 1 1 0 0 1 2 10 6 1 0 0 1 3 10 27 1 0 0 1 4 10 31 1 0 0 1 5 10 42 1 0 0 2 1 10 1 2 0 0 2 2 10 6 2 0 0 2 3 10 27 2 0 0 2 4 10 31 2 0 0 2 5 10 42 2 0 0 3 1 10 1 3 0 0 3 2 10 6 3 0 0 3 3 10 27 3 0 0 3 4 10 31 3 0 0 3 5 10 42 3 0 0 4 1 10 1 4 0 0 4 2 10 6 4 0 0 4 3 10 27 4 0 0 4 4 10 31 4 0 0 4 5 10 42 4 0 0 5 1 10 1 5 0 0 5 2 10 6 5 0 0 5 3 10 27 5 0 0 5 4 10 31 5 0 0 5 5 10 42 5 0 0 6 1 10 1 6 0 0 6 2 10 6 6 0 0 6 3 10 27 6 0 0 6 4 10 31 6 0 0 6 5 10 42 6 0 0 7 1 10 1 7 0 0 7 2 10 6 7 0 0 7 3 10 27 7 0 0 7 4 10 31 7 0 0 7 5 10 42 7 0 0 8 1 10 1 8 0 0 8 2 10 6 8 0 0 8 3 10 27 8 0 0 8 4 10 31 8 0 0 8 5 10 42 8 0 0 9 1 10 1 9 0 0 9 2 10 6 9 0 0 9 3 10 27 9 0 0 9 4 10 31 9 0 0 9 5 10 42 9 0 0 10 1 10 1 10 0 0 10 2 10 6 10 0 0 10 3 10 27 10 0 0 10 4 10 31 10 0 0 10 5 10 42 10 0 0 | 
| % 0 0.2 72 11.2 2 drawBox 0 1.2 72 1.2 1 0 1 10 drawRepeatLine % 5 0.2 5 11.2 1 drawLine 26 0.2 26 11.2 1 drawLine 30 0.2 30 11.2 1 drawLine 41 0.2 41 11.2 1 drawLine % 10 KFONT_GOTHIC setKanjiChar % 10 FONT_NORMAL setChar 1 0 <番号> drawText 6 0 <氏名> drawText 27 0 <性別> drawText 31 0 <生年月日> drawText 42 0 <住所> drawText | 
| 
%!
% start user definition
%
% < X unit length (point) >
%
/SYS_Char {72.00 10 div} def
%
% < Y unit length (point) >
%
/SYS_Line {72.00  6 div} def
%
% < X bias (Char) >
%
/SYS_Xbias {2 SYS_Char mul} def
%
% < Y bias (Line) >
%
/SYS_Ybias {-2 SYS_Line mul} def
%
% < max printable width (Char) >
%
/SYS_MaxWidth 80 def
%
% < max printable height (Line) >
%
/SYS_MaxHeight 66 def
%
% end user definition
%
%----------------------------------------------------------------------
%
% start system definition
%
% CHAR c2p ... convert Char to point
%
/c2p {
    /SYS_c2p_CHAR_X exch def
    SYS_c2p_CHAR_X SYS_Char mul
    SYS_Xbias add
} def
%
% LINE l2p ... convert Line to point
%
/l2p {
    /SYS_l2p_LINE_Y exch def
    SYS_MaxHeight SYS_Line mul
    SYS_Ybias sub
    SYS_l2p_LINE_Y SYS_Line mul
    sub
} def
%
% DASH setLineStyle (DASH is 0 or 1 or ... )
%
/setLineStyle {
    /SYS_setLineStyle_DASH exch def
    0 SYS_setLineStyle_DASH eq {[] 0 setdash}
                               {[SYS_setLineStyle_DASH] 0 setdash} ifelse
} def
%
% GRAY setGrayScale (GRAY is 0 to 1)
%
/setGrayScale {
    setgray
} def
%
% X0 Y0 X1 Y1 WIDTH drawLine
%
/drawLine {
    /SYS_drawLine_WIDTH  exch def
    /SYS_drawLine_Y1     exch def
    /SYS_drawLine_X1     exch def
    /SYS_drawLine_Y0     exch def
    /SYS_drawLine_X0     exch def
    newpath
    SYS_drawLine_WIDTH setlinewidth
    SYS_drawLine_X0 c2p SYS_drawLine_Y0 l2p moveto
    SYS_drawLine_X1 c2p SYS_drawLine_Y1 l2p lineto
    stroke
} def
%
% X0 Y0 X1 Y1 WIDTH XDELTA YDELTA REPEAT drawRepeatLine
%
/drawRepeatLine {
    /SYS_drawRepeatLine_REPEAT exch def
    /SYS_drawRepeatLine_YDELTA exch def
    /SYS_drawRepeatLine_XDELTA exch def
    /SYS_drawRepeatLine_WIDTH  exch def
    /SYS_drawRepeatLine_Y1     exch def
    /SYS_drawRepeatLine_X1     exch def
    /SYS_drawRepeatLine_Y0     exch def
    /SYS_drawRepeatLine_X0     exch def
    SYS_drawRepeatLine_REPEAT {
        SYS_drawRepeatLine_X0 SYS_drawRepeatLine_Y0
        SYS_drawRepeatLine_X1 SYS_drawRepeatLine_Y1 
        SYS_drawRepeatLine_WIDTH drawLine
        SYS_drawRepeatLine_X0 SYS_drawRepeatLine_XDELTA add
        /SYS_drawRepeatLine_X0 exch def
        SYS_drawRepeatLine_Y0 SYS_drawRepeatLine_YDELTA add
        /SYS_drawRepeatLine_Y0 exch def
        SYS_drawRepeatLine_X1 SYS_drawRepeatLine_XDELTA add
        /SYS_drawRepeatLine_X1 exch def
        SYS_drawRepeatLine_Y1 SYS_drawRepeatLine_YDELTA add
        /SYS_drawRepeatLine_Y1 exch def
    } repeat
} def
%
% X0 Y0 X1 Y1 WIDTH drawBox
%
/drawBox {
    /SYS_drawBox_WIDTH exch def
    /SYS_drawBox_Y1 exch def
    /SYS_drawBox_X1 exch def
    /SYS_drawBox_Y0 exch def
    /SYS_drawBox_X0 exch def
    SYS_drawBox_X0 SYS_drawBox_Y0 SYS_drawBox_X0 SYS_drawBox_Y1
    SYS_drawBox_WIDTH drawLine
    SYS_drawBox_X0 SYS_drawBox_Y1 SYS_drawBox_X1 SYS_drawBox_Y1 
    SYS_drawBox_WIDTH drawLine
    SYS_drawBox_X1 SYS_drawBox_Y1 SYS_drawBox_X1 SYS_drawBox_Y0 
    SYS_drawBox_WIDTH drawLine
    SYS_drawBox_X1 SYS_drawBox_Y0 SYS_drawBox_X0 SYS_drawBox_Y0 
    SYS_drawBox_WIDTH drawLine
} def 
%
% X0 Y0 X1 Y1 fillBox
%
/fillBox {
    /SYS_fillBox_Y1 exch def
    /SYS_fillBox_X1 exch def
    /SYS_fillBox_Y0 exch def
    /SYS_fillBox_X0 exch def
    newpath
    SYS_fillBox_X0 c2p SYS_fillBox_Y0 l2p moveto
    SYS_fillBox_X0 c2p SYS_fillBox_Y1 l2p lineto
    SYS_fillBox_X1 c2p SYS_fillBox_Y1 l2p lineto
    SYS_fillBox_X1 c2p SYS_fillBox_Y0 l2p lineto
    closepath
    fill
} def
%
% POINT FONT setChar
%
/FONT_NORMAL     0 def
/FONT_ITALIC     1 def
/FONT_BOLD       2 def
/FONT_BOLDITALIC 3 def
%
/setChar {
    /SYS_setChar_FONT exch def
    /SYS_setChar_POINT exch def
    SYS_setChar_FONT FONT_NORMAL eq {/Courier findfont} if
    SYS_setChar_FONT FONT_ITALIC eq {/Courier_Italic findfont} if
    SYS_setChar_FONT FONT_BOLD eq {/Courier_Bold findfont} if
    SYS_setChar_FONT FONT_BOLDITALIC eq {/Courier_BoldItalic findfont} if
    SYS_setChar_POINT scalefont
    setfont
} def 
%
% POINT KFONT setKanjiChar
%
/KFONT_RYUMIN   0 def
/KFONT_RYUMIN_V 1 def
/KFONT_GOTHIC   2 def
/KFONT_GOTHIC_V 3 def
%
/setKanjiChar {
    /SYS_setKanjiChar_KFONT exch def
    /SYS_setKanjiChar_POINT exch def
    SYS_setKanjiChar_KFONT KFONT_RYUMIN eq {/Ryumin-Light-H findfont} if
    SYS_setKanjiChar_KFONT KFONT_RYUMIN_V eq {/Ryumin-Light-V findfont} if
    SYS_setKanjiChar_KFONT KFONT_GOTHIC eq {/GothicBBB-Medium-H findfont} if
    SYS_setKanjiChar_KFONT KFONT_GOTHIC_V eq {/GothicBBB-Medium-V findfont} if
    SYS_setKanjiChar_POINT scalefont
    setfont
} def 
%
% X Y (TEXT) drawText
% X Y  | 
|   | 
% start user definition
%------------------------------------------------------------------
% < X unit length (point) >
%
% オーバレイ定義、帳票フォーマット定義中で指定する座標系のX軸の単位長を
% 指定します。デフォルトは72/10ポイント(=1/10インチ)です。
%
/SYS_Char {72.00 10 div} def
%
%------------------------------------------------------------------
% < Y unit length (point) >
%
% オーバレイ定義、帳票フォーマット定義中で指定する座標系のY軸の単位長を
% 指定します。デフォルトは72/6ポイント(=1/6インチ)です。
%
/SYS_Line {72.00  6 div} def
%
%------------------------------------------------------------------
% < X bias (Char) >
%
% ページ全体のX軸方向の印字位置調整に使用します。
% 右にずらす : 正数で指定
% 左にずらす : 負数で指定
%
% for FUJITSU XL-5340
%/SYS_Xbias {2 SYS_Char mul} def
%
/SYS_Xbias {0 SYS_Char mul} def
%
%------------------------------------------------------------------
% < Y bias (Line) >
% 
% ページ全体のY軸方向の印字位置調整に使用します。
% 下にずらす : 正数で指定
% 上にずらす : 負数で指定
%
% for FUJITSU XL-5340
%/SYS_Ybias {-2 SYS_Line mul} def
%
/SYS_Ybias {0 SYS_Line mul} def
%
%------------------------------------------------------------------
% < max printable width (Char) >
%
% 最大印字幅をSYS_Char単位で指定します。
%
/SYS_MaxWidth 80 def
%
%------------------------------------------------------------------
% < max printable height (Line) >
%
% 最大印字行数をSYS_Line単位で指定します。
%
/SYS_MaxHeight 66 def
%
%------------------------------------------------------------------
% end user definition
(例) B4縦の用紙を利用したい場合
a4v.ps, a4h.ps内で、
a4v.ps, a4h.ps内で、
PUA(外字)を扱うための設定は以下を参照の上、フォントへの対応づけをPUAを含んだフォントに変更して下さい :)
レコード番号△フィールド番号△ポイント△カラム△ライン△X間隔△Y間隔