diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2022-07-07 10:54:20 -0500 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2022-07-07 23:19:31 -0500 |
commit | 645a371a568b2e2cd518ba5505eb69259af3d065 (patch) | |
tree | b879ee2e6d231514290c283cc4a715002cd2464d /font | |
parent | 7e017781dbdcc3558303bc2191ee0da4e5cd026c (diff) | |
download | groff-git-645a371a568b2e2cd518ba5505eb69259af3d065.tar.gz |
[devpdf]: Check for errors more.
* font/devpdf/util/BuildFoundries.pl: Add Boolean-value scalar
`beStrict` (defaults false) and new command-line option `--strict` to
make it true.
(LoadFoundry): Check return value of subroutine `LocateAF`. Emit
diagnostic if it is null, as a warning if not "strict", and fatal if
so.
Diffstat (limited to 'font')
-rw-r--r-- | font/devpdf/util/BuildFoundries.pl | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/font/devpdf/util/BuildFoundries.pl b/font/devpdf/util/BuildFoundries.pl index 76c1bef87..a0e498e6f 100644 --- a/font/devpdf/util/BuildFoundries.pl +++ b/font/devpdf/util/BuildFoundries.pl @@ -28,8 +28,10 @@ my $pathsep='@PATH_SEPARATOR@'; my $check=0; my $dirURW=''; +my $beStrict=0; -GetOptions("check" => \$check, "dirURW=s" => \$dirURW); +GetOptions("check" => \$check, "dirURW=s" => \$dirURW, + "strict" => \$beStrict); (my $progname = $0) =~s @.*/@@; my $where=shift||''; @@ -142,8 +144,15 @@ sub LoadFoundry } else { - # We need to run afmtodit to create this groff font - my $psfont=RunAfmtodit($gfont,LocateAF($foundrypath,$r[5]),$r[2],$r[3],$r[4]); + # Use afmtodit to create a groff font description file. + my $afmfile=LocateAF($foundrypath,$r[5]); + if (!$afmfile) { + my $sub=\&Warn; + $sub=\&Die if ($beStrict); + &$sub("cannot locate AFM file for font '$gfont'"); + next; + } + my $psfont=RunAfmtodit($gfont,$afmfile,$r[2],$r[3],$r[4]); if ($psfont) { |