summaryrefslogtreecommitdiff
path: root/fonts/modes/modedpicheck
blob: 3a2fb070b072480789b91fa8951dedfb874e3aaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
# $Id: modedpicheck,v 1.2 2020/01/28 18:57:25 karl Exp $
# Check that the resolution of all defined modes is as intended,
# and that landscape works.  Public domain.
 
modes=modes.mf

for j in `grep '^mode_def' $modes | awk '$2 != "help" {print $2}'`; do
  mf_bdpi=`mf '\mode:='$j';mode_setup;message"BDPI= "&decimal round pixels_per_inch;end.' </dev/null | awk '/DPI=/ {print $2}'`
  mf_lbdpi=`mf '\mode:='$j';landscape; mode_setup;message"BDPI= "&decimal round pixels_per_inch;end.' </dev/null | awk '/DPI=/ {print $2}'`
  if test "$mf_bdpi" = "$mf_lbdpi"; then
    grep "^mode_def $j.*($mf_bdpi dpi)" $modes >/dev/null 2>&1 ||
      echo $j
  else
    grep "^mode_def $j.*(${mf_bdpi}x$mf_lbdpi dpi)" $modes  >/dev/null 2>&1 ||
      echo $j
  fi
done