prov-2.2 -- Overlay printing utility for UNIX-like systems
Counter[
]
JAPANESE
What is prov2 ?
This is form overlay printing tool on UNIX-like systems.
prov-1.x worked with EUC-JP for encoding.
prov-2.x works with UTF-8 for encoding now :)
Prerequisite
You must be able to print postscript file.
Download
Install
- edit Makefile to set install directory to PROV2DIR macro.
default install directory is ~/prov2.
- make
- make install
- edit ~/.profile to set install directory to PROV2DIR environment variable.
ex. PROV2DIR=~/prov2; export PROV2DIR
- edit ~/.profile to set ${PROV2DIR}/bin to PATH environment variable.
ex. PATH="${PATH}:${PROV2DIR}/bin"; export PATH
Sample print(1)
prov2 -text mesh.ov README | lpr -Pps-printer
or
cat README | prov2 -text mesh.ov - | lpr -Pps-printer
above operation printout README
overlayed mesh.ov(mesh overlay definition) from ps-printer.
(Postscript file, Image)
default point of ank is 12point and default point of kanji char is 12point too.
you can change default point by setting environment variable.
- PROV2_ANK_POINT (default 12)
- PROV2_KANJI_POINT (default 12)
- PROV2_ANK_XGAP (default 0)
- PROV2_ANK_YGAP (default 0)
- PROV2_KANJI_XGAP (default 2.4)
- PROV2_KANJI_YGAP (default 0)
Sample print(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
above operation printout
member.dat(csv data file) formatted by
member.def(format definition) and overlayed
table.ov(table overlay definition) from ps-printer.
(Postscript file, Image)
Adjust setting
You can adjust setting by editing ${PROV2DIR}/etc/a4v.ps.
% start user definition
%------------------------------------------------------------------
% < X unit length (point) >
%
% default is 72/10 point (=1/10 inch).
%
/SYS_Char {72.00 10 div} def
%
%------------------------------------------------------------------
% < Y unit length (point) >
%
% default is 72/6 point (=1/6 inch).
%
/SYS_Line {72.00 6 div} def
%
%------------------------------------------------------------------
% < X bias (Char) >
%
% move page to right : plus value
% move page to left : minus value
%
% for FUJITSU XL-5340
%/SYS_Xbias {2 SYS_Char mul} def
%
/SYS_Xbias {0 SYS_Char mul} def
%
%------------------------------------------------------------------
% < Y bias (Line) >
%
% move page to down : plus value
% move page to up : minus value
%
% for FUJITSU XL-5340
%/SYS_Ybias {-2 SYS_Line mul} def
%
/SYS_Ybias {0 SYS_Line mul} def
%
%------------------------------------------------------------------
% < max printable width (Char) >
%
/SYS_MaxWidth 80 def
%
%------------------------------------------------------------------
% < max printable height (Line) >
%
/SYS_MaxHeight 66 def
%
%------------------------------------------------------------------
% end user definition
Customize
In default ${PROV2DIR}/etc/a4v.ps is for A4-portrait paper. if you want to
use another paper, copy ${PROV2DIR}/etc/a4v.ps to another.ps and edit it and
set path to another.ps into PROV2PS(environment variable).
- cp ${PROV2DIR}/etc/a4v.ps ./another.ps
- vi ./another.ps # edit for another paper
- PROV2PS=./another.ps prov2 -text foo.ov foo.txt | lpr -Pps-printer
Overlay definition
You can use following postscript macro to define overlay.
- DASH setLineStyle (DASH is 0 or 1 or ... )
set line style (solid, dash etc). DASH=0 mean solid line, DASH>=1 mean dash
line.
- GRAY setGrayScale (GRAY is 0 to 1)
set gray scale. 0=black -> 0.5=gray -> 1=white.
- X0 Y0 X1 Y1 WIDTH drawLine
draw line between (X0,Y0) to (X1,Y1) with WIDTH width.
(X0,Y0),(X1,Y1) are (character,line) coordinate.
WIDTH is point.
- X0 Y0 X1 Y1 WIDTH XDELTA YDELTA REPEAT drawRepeatLine
repeat to draw line from (X0,Y0)-(X1,Y1) REPEAT times with increasing XDELTA
and YDELTA.
- X0 Y0 X1 Y1 WIDTH drawBox
draw box with WIDTH width.
- X0 Y0 X1 Y1 fillBox
draw box and fill inside.
- POINT FONT_{NORMAL|ITALIC|BOLD|BOLDITALIC} setChar
set ank charset.
- POINT KFONT_{RYUMIN|RYUMIN_V|GOTHIC|GOTHIC_V} setKanjiChar
set kanji charset.
- GAP setXgap
set x-gap between chars.
- GAP setYgap
set y-gap between chars.
- X Y (TEXT) drawText
draw text with ank charset. (X,Y) mean (left,top) of charcter.
- X Y <KANJI_TEXT> drawText
draw text with kanji charset. (X,Y) mean (left,top) of charcter.
Format definition
You must define format definition to format print layout
from csv data file. each line of format definition
is defined like following.
record_no field_no point column line x_gap y_gap
- record_no : set record number. usually record_no is 1, but a page is
formatted from multi record, over 2 are used too.
- field_no : set field number from csv data file record.
- point : set character point.
- column : set print column position.
- line : set print line position.
- x_gap : set x gap between chars
- y_gap : set y gap between chars
field separater of format definition file is TAB.
Csv data file
- field separater of csv data file is TAB.
- a field can't hold ank/kanji together.
Masahiko Ito <m-ito@myh.no-ip.org>