diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-24 18:07:45 -0600 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-25 02:48:06 -0600 |
commit | 168d596d31ecf3b0af67e41932c4cf1782a8edbf (patch) | |
tree | 4877096c030bc924dea841fbf3791b02a7cc0673 /font | |
parent | 046d3c6b3b690d3b697a5f94c595d8d8f77bb4c7 (diff) | |
download | groff-git-168d596d31ecf3b0af67e41932c4cf1782a8edbf.tar.gz |
[devpdf]: Revise tests.
* font/devpdf/tests/check-default-foundry.sh.in: Test only the base 14
fonts of the PDF standard unconditionally. Test the remainder from
the set of 35 commonly distributed only if a Ghostscript interpreter
was detected at configuration time, because the latter fonts _must_ be
embedded in PDF documents. If they're not present, skip the test
rather than failing it.
* font/devpdf/tests/check-urw-foundry.sh.in: Skip test if no URW fonts
detected at configuration time, rather than failing it.
* m4/groff.m4 (GROFF_GROPDF_PROGRAM_NOTICE, GROFF_URW_FONTS_NOTICE):
Drop warnings of expected test failures. The tests no longer fail in
the anticipated circumstances.
Diffstat (limited to 'font')
-rwxr-xr-x | font/devpdf/tests/check-default-foundry.sh.in | 83 | ||||
-rwxr-xr-x | font/devpdf/tests/check-urw-foundry.sh.in | 13 |
2 files changed, 60 insertions, 36 deletions
diff --git a/font/devpdf/tests/check-default-foundry.sh.in b/font/devpdf/tests/check-default-foundry.sh.in index 1ddd83d0b..026cc012a 100755 --- a/font/devpdf/tests/check-default-foundry.sh.in +++ b/font/devpdf/tests/check-default-foundry.sh.in @@ -18,19 +18,42 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -# Ensure that groff's PDF device has font description files for the -# default (unnamed) foundry's PostScript Level 2 base 35 fonts, plus -# groff's EURO. -# -# These font descriptions should be available in any gropdf -# configuration because they can be copied from the devps font -# descriptions even if the URW fonts are not available. -# -# Another test script checks the "U" (URW) foundry. - devpdf_fontbuilddir="${abs_top_builddir:-.}"/font/devpdf +ghostscript=@GHOSTSCRIPT@ + +wail () { + echo ...FAILED >&2 + fail=yes +} + +fail= + +# The are the base 14 fonts required by the PDF standard. They should +# _always_ be present and supported. If their corresponding Type 1 font +# files are available, they too can be embedded in a PDF using gropdf's +# "-e" option. groff's "EURO" font is always available; we ship it. +mandatory_fonts='CB +CBI +CI +CR +HB +HBI +HI +HR +S +TB +TBI +TI +TR +ZD' -fonts='AB +# These fonts are commonly, but not universally, available; if used, +# their corresponding Type 1 font files must be embedded in a document. +# +# Their groff font descriptions will always be available: we ship them. +# But they are not usable with gropdf(1) if the Type 1 files are absent. +# We thus will not test them if they are not expected to work. +supplementary_fonts='AB ABI AI AR @@ -38,19 +61,10 @@ BMB BMBI BMI BMR -CB -CBI -CI -CR -EURO -HB -HBI -HI HNB HNBI HNI HNR -HR NB NBI NI @@ -59,24 +73,25 @@ PB PBI PI PR -S -TB -TBI -TI -TR -ZCMI -ZD' +ZCMI' -fail= +for f in $mandatory_fonts +do + printf "checking for font description %s...\n" "$f" >&2 + test -f "$devpdf_fontbuilddir"/"$f" || wail +done + +if [ "$ghostscript" = no ] || [ "$ghostscript" = missing ] +then + echo "Ghostscript not available; skipping check for any further" \ + "fonts in the default foundry" >&2 + exit 77 # skip +fi -for f in $fonts +for f in $supplementary_fonts do printf "checking for font description %s...\n" "$f" >&2 - if ! [ -f "$devpdf_fontbuilddir"/"$f" ] - then - echo FAILED >&2 - fail=yes - fi + test -f "$devpdf_fontbuilddir"/"$f" || wail done test -z "$fail" diff --git a/font/devpdf/tests/check-urw-foundry.sh.in b/font/devpdf/tests/check-urw-foundry.sh.in index 9d4e514bf..d31b3aa3e 100755 --- a/font/devpdf/tests/check-urw-foundry.sh.in +++ b/font/devpdf/tests/check-urw-foundry.sh.in @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2022 Free Software Foundation, Inc. +# Copyright (C) 2022-2023 Free Software Foundation, Inc. # # This file is part of groff. # @@ -19,8 +19,17 @@ # # Ensure that groff's PDF device has URW font descriptions it expects. +# These are generated at build time by afmtodit(1) if a URW font +# directory was discovered at configuration time. devpdf_fontbuilddir="${abs_top_builddir:-.}"/font/devpdf +urwfontsdir=@urwfontsdir@ + +if [ -z "$urwfontsdir" ] +then + echo "URW fonts not found at configuration time; skipping" >&2 + exit 77 # skip +fi fonts='AB ABI @@ -67,7 +76,7 @@ do if ! test -f "$devpdf_fontbuilddir"/$f then echo test -f "$devpdf_fontbuilddir"/$f - echo FAILED >&2 + echo ...FAILED >&2 fail=yes fi done |