1
# make a device mode list from 'modes.mf' file (given in stdin)
4
# Line: e.g., mode_def ljfour = % 600dpi HP LaserJet 4
13
desc=substr($0, i + match(x, "[a-zA-Z0-9]") - 1);
17
# Line: e.g., mode_param (pixels_per_inch, 600);
19
/^[ \t]*mode_param[ \t]*\([ \t]*pixels_per_inch, [ \t]*[0-9.]+\);/ {
21
ppi=substr($3, 1, RLENGTH);
26
### Currently, aspect ratio must be 1
28
# Line: e.g., mode_param (aspect_ratio, 4/3);
30
/^[ \t]*mode_param[ \t]*\([ \t]*aspect_ratio[ \t]*,[ \t]*[0-9./]+[ \t]*);/ {
31
i=match($0, ",[ \t]*");
35
asp=substr($0, s0, len-1);
37
ppi=-1; ### ignore this entry.
41
# Line: e.g., mode_param (aspect_ratio, 180 / pixels_per_inch);
43
/^[ \t]*mode_param[ \t]*\([ \t]*aspect_ratio, [ \t]*.*\/[ \t]*pixels_per_inch)/ {
44
i=match($0, ",[ \t]*[0-9.]");
45
x=substr($0, i+RLENGTH-1);
48
ppiv=substr($0, s0, RSTART-1);
50
ppi=-1; ### ignore this entry.
56
if ((mode != "") && (ppi > 0)){
57
if ((ppiv < 0) && (mode == DEVNAME)){