| 1 |
#!/bin/sh |
| 2 |
# $Id: modedpicheck,v 1.2 2020/01/28 18:57:25 karl Exp $ |
| 3 |
# Check that the resolution of all defined modes is as intended, |
| 4 |
# and that landscape works. Public domain. |
| 5 |
|
| 6 |
modes=modes.mf |
| 7 |
|
| 8 |
for j in `grep '^mode_def' $modes | awk '$2 != "help" {print $2}'`; do |
| 9 |
mf_bdpi=`mf '\mode:='$j';mode_setup;message"BDPI= "&decimal round pixels_per_inch;end.' </dev/null | awk '/DPI=/ {print $2}'` |
| 10 |
mf_lbdpi=`mf '\mode:='$j';landscape; mode_setup;message"BDPI= "&decimal round pixels_per_inch;end.' </dev/null | awk '/DPI=/ {print $2}'` |
| 11 |
if test "$mf_bdpi" = "$mf_lbdpi"; then |
| 12 |
grep "^mode_def $j.*($mf_bdpi dpi)" $modes >/dev/null 2>&1 || |
| 13 |
echo $j |
| 14 |
else |
| 15 |
grep "^mode_def $j.*(${mf_bdpi}x$mf_lbdpi dpi)" $modes >/dev/null 2>&1 || |
| 16 |
echo $j |
| 17 |
fi |
| 18 |
done |