diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-18 16:44:08 -0600 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-18 16:45:53 -0600 |
commit | 6e001a7f397438d7f09e97155b3c1ec89c1fc855 (patch) | |
tree | 766c266b4682edd028f28e4592ebeaa31d4053ac /font | |
parent | 206dcc0806b4da9d9d197540f4fa3aa86274d28b (diff) | |
download | groff-git-6e001a7f397438d7f09e97155b3c1ec89c1fc855.tar.gz |
[gropdf]: Bifurcate test of font availability.
* font/devpdf/tests/check-default-foundry.sh: Bifurcate test of font
availability. The Ghostscript executable can be present in the host
environment without any Type 1 fonts. The PDF standard requires that
its base 14 be present in the renderer, so groff font descriptions for
those 14 fonts (plus groff's "EURO" font) should always be available.
But the remaining fonts from the "Base 35" PostScript level 2 set
won't necessarily be, and so their font descriptions won't be, either.
Skip the test rather than failing it in that case, because the
Ghostscript executable can have any number of fonts built-in (in
"%rom%" as "gs -h" puts it). We'll need a more sophisticated Autoconf
test to discern this scenario from a true failure case.
Diffstat (limited to 'font')
-rwxr-xr-x | font/devpdf/tests/check-default-foundry.sh | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/font/devpdf/tests/check-default-foundry.sh b/font/devpdf/tests/check-default-foundry.sh index 1ddd83d0b..9e1c729c5 100755 --- a/font/devpdf/tests/check-default-foundry.sh +++ b/font/devpdf/tests/check-default-foundry.sh @@ -30,15 +30,7 @@ devpdf_fontbuilddir="${abs_top_builddir:-.}"/font/devpdf -fonts='AB -ABI -AI -AR -BMB -BMBI -BMI -BMR -CB +base_fonts='CB CBI CI CR @@ -46,11 +38,26 @@ EURO HB HBI HI +HR +S +TB +TBI +TI +TR +ZD' + +additional_fonts='AB +ABI +AI +AR +BMB +BMBI +BMI +BMR HNB HNBI HNI HNR -HR NB NBI NI @@ -59,17 +66,11 @@ PB PBI PI PR -S -TB -TBI -TI -TR -ZCMI -ZD' +ZCMI' fail= -for f in $fonts +for f in $base_fonts do printf "checking for font description %s...\n" "$f" >&2 if ! [ -f "$devpdf_fontbuilddir"/"$f" ] @@ -79,6 +80,22 @@ do fi done -test -z "$fail" +test -n "$fail" && exit 1 # fail + +# The "Base 35" fonts (not including the PDF base 14) are not guaranteed +# to be present even if the Ghostscript executable is installed. Skip +# the test rather than failing if they're not present. +# +# TODO: Come up with a more sophisicated Autoconf test to detect this. + +for f in $additional_fonts +do + printf "checking for font description %s...\n" "$f" >&2 + if ! [ -f "$devpdf_fontbuilddir"/"$f" ] + then + echo "non-base fonts not available; skipping test" >&2 + exit 77 # skip + fi +done # vim:set ai et sw=4 ts=4 tw=72: |