groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 09/09: [gropdf]: Bifurcate test of font availability.


From: G. Branden Robinson
Subject: [groff] 09/09: [gropdf]: Bifurcate test of font availability.
Date: Sat, 18 Feb 2023 18:00:45 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 6e001a7f397438d7f09e97155b3c1ec89c1fc855
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Feb 18 16:44:08 2023 -0600

    [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.
---
 ChangeLog                                  | 15 ++++++++
 font/devpdf/tests/check-default-foundry.sh | 55 +++++++++++++++++++-----------
 2 files changed, 51 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 998ce594d..a9cdd6a82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2023-02-18  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * 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.
+
 2023-02-18  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * font/devpdf/Foundry.in: Recognize URW foundry replacements for
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:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]