6
MODES_MF=`kpsewhich modes.mf`
8
if [ x-${MODES_MF} = x- ]
10
echo "Not found: modes.mf" >&2
14
if [ ! -f ${MODES_MF} ]
16
echo "Not found: modes.mf" >&2
23
| awk -v DEVNAME=${k_dev} '
31
printf("-1\n"); # not found
34
printf("%s\n", DEVDPI);
38
# Line: e.g., mode_def ljfour = % 600dpi HP LaserJet 4
46
desc=substr($0, i + match(x, "[a-zA-Z0-9]") - 1);
49
# Line: e.g., mode_param (pixels_per_inch, 600);
50
/^[ \t]*mode_param[ \t]*\([ \t]*pixels_per_inch, [ \t]*[0-9.]+\);/ {
52
ppi=substr($3, 1, RLENGTH);
56
# Line: e.g., mode_param (aspect_ratio, 4/3);
57
# Currently, aspect ratio must be 1
58
/^[ \t]*mode_param[ \t]*\([ \t]*aspect_ratio[ \t]*,[ \t]*[0-9./]+[ \t]*);/ {
59
i=match($0, ",[ \t]*");
63
asp=substr($0, s0, len-1);
65
ppi=-1; ### ignore this entry.
68
# Line: e.g., mode_param (aspect_ratio, 180 / pixels_per_inch);
69
/^[ \t]*mode_param[ \t]*\([ \t]*aspect_ratio, [ \t]*.*\/[ \t]*pixels_per_inch)/ {
70
i=match($0, ",[ \t]*[0-9.]");
71
x=substr($0, i+RLENGTH-1);
74
ppiv=substr($0, s0, RSTART-1);
76
ppi=-1; ### ignore this entry.
81
if ((mode != "") && (ppi > 0)){
82
if ((ppiv < 0) && (mode == DEVNAME)){