Hi Deri, Please find attached a patch to improve some "download" file-related diagnostics. I was having particular trouble with the first.
The underlying problem is that gropdf+"download" don't know about build trees; they expect to operate only in an installation environment. Since "StandardSymSL.pfb" is shipped in the Git repo (and eventual distribution archive), make(1) is not inclined to do anything with it. (If the build tree is the same as the source tree, there is nothing to do; if it isn't, we don't have a rule telling make(1) _what_ to do.) As noted in Savannah #65098,[1] I'd prefer to build the PFB file from "source" if we can. But for this patch all I am trying to accomplish is a more intelligible diagnostic (or two). It: 1. Changes the `missing` hash to store not merely the name of the directory where gropdf expected to find an embeddable font file that isn't present, but the entire pathname of the font file, since the last (or "basename") portion communicates valuable information. The value in this hash seemed to be used only as a flag, so this seemed convenient, with no impact on other code except the one place I wanted it. 2. Changes the warning diagnostic to report that absent file. 3. Parallelizes the language of the similar warning diagnostic when there is no entry in the 'download' file for an embeddable font in the first place with the foregoing. Also I've been migrating groff's diagnostic messages from the locutions "can't", "unable to", and "failed to" to "cannot", for economy and consistency. The last is shorter than the alternatives except for the one using a character that we also employ to bracket literals that might contain space characters and thus could be confusing. So I did that here as well. Ok to push? Regards, Branden [1] https://savannah.gnu.org/bugs/?65098
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl index 409f15284..f9066dd6e 100644 --- a/src/devices/gropdf/gropdf.pl +++ b/src/devices/gropdf/gropdf.pl @@ -2,7 +2,7 @@ # # gropdf : PDF post processor for groff # -# Copyright (C) 2011-2024 Free Software Foundation, Inc. +# Copyright (C) 2011-2025 Free Software Foundation, Inc. # Written by Deri James <d...@chuzzlewit.myzen.co.uk> # # This file is part of groff. @@ -1193,7 +1193,7 @@ sub LoadDownload if (!-r $pth) { - $missing{"$foundry $name"}="$dir/$devnm"; + $missing{"$foundry $name"}="$pth"; next; } @@ -3511,13 +3511,14 @@ sub LoadFont { if (exists($missing{$fontkey})) { - Warn("The download file in '$missing{$fontkey}' " - . " has erroneous entry for '$fnt{internalname} ($ofontnm)'"); + Warn("cannot embed '$missing{$fontkey}' providing font" + . " '$fnt{internalname}' ($ofontnm); incorrect entry in" + . " 'download' file?"); } else { - Warn("unable to embed font file for '$fnt{internalname}'" - . " ($ofontnm) (missing entry in 'download' file?)") + Warn("cannot embed font file for '$fnt{internalname}'" + . " ($ofontnm); missing entry in 'download' file?") if $embedall; } }
signature.asc
Description: PGP signature