groff-commit
[Top][All Lists]
Advanced

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

[groff] 33/35: [build]: Add gropdf font description sanity tests.


From: G. Branden Robinson
Subject: [groff] 33/35: [build]: Add gropdf font description sanity tests.
Date: Fri, 15 Jul 2022 23:12:01 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit ca0c6eb84bdcf08b518f4c70318f84fb91b863c8
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Jul 14 08:38:51 2022 -0500

    [build]: Add gropdf font description sanity tests.
    
    [build]: Add sanity checks for font description file generation for PDF
    output device, prompted by discussion with Ingo Schwarze.  See
    <https://lists.gnu.org/archive/html/groff/2022-06/msg00094.html>.
    
    * font/devpdf/tests/basic-fonts-present.sh:
    * font/devpdf/tests/urw-fonts-present.sh: Add files.
    
    * font/devpdf/devpdf.am (font_devpdf_TESTS): Add the former test
      unconditionally, and the latter only if `HAVE_URW_FONTS`.
---
 ChangeLog                                | 13 ++++++
 font/devpdf/devpdf.am                    |  9 ++++
 font/devpdf/tests/basic-fonts-present.sh | 47 +++++++++++++++++++
 font/devpdf/tests/urw-fonts-present.sh   | 79 ++++++++++++++++++++++++++++++++
 4 files changed, 148 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index dc42fbb8..c048bdcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2022-07-14  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [build]: Add sanity checks for font description file generation
+       for PDF output device, prompted by discussion with Ingo
+       Schwarze.  See <https://lists.gnu.org/archive/html/groff/\
+       2022-06/msg00094.html>.
+
+       * font/devpdf/tests/basic-fonts-present.sh:
+       * font/devpdf/tests/urw-fonts-present.sh: Add files.
+
+       * font/devpdf/devpdf.am (font_devpdf_TESTS): Add the former test
+       unconditionally, and the latter only if `HAVE_URW_FONTS`.
+
 2022-07-14  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * font/devpdf/devpdf.am: Refactor to simplify.  Now that
diff --git a/font/devpdf/devpdf.am b/font/devpdf/devpdf.am
index b2eecfac..663774f0 100644
--- a/font/devpdf/devpdf.am
+++ b/font/devpdf/devpdf.am
@@ -170,6 +170,15 @@ uninstall_devpdf:
          rmdir $(DESTDIR)$(devpdffontdir); \
        fi
 
+font_devpdf_TESTS = \
+  font/devpdf/tests/basic-fonts-present.sh
+
+if HAVE_URW_FONTS
+font_devpdf_TESTS += font/devpdf/tests/urw-fonts-present.sh
+endif
+
+TESTS += $(font_devpdf_TESTS)
+EXTRA_DIST += $(font_devpdf_TESTS)
 
 # Local Variables:
 # mode: makefile-automake
diff --git a/font/devpdf/tests/basic-fonts-present.sh 
b/font/devpdf/tests/basic-fonts-present.sh
new file mode 100755
index 00000000..5b55ed5e
--- /dev/null
+++ b/font/devpdf/tests/basic-fonts-present.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# Copyright (C) 2022 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+# Ensure that groff's PDF device has the copies it needs of PostScript
+# device font descriptions.
+#
+# We need all of them except SS and ZDR.
+
+devps_fontsrcdir="${abs_top_srcdir:-..}"/font/devps
+devpdf_fontbuilddir="${abs_top_builddir:-.}"/font/devpdf
+
+psfonts=$(cd "$devps_fontsrcdir" && ls [A-Z]* \
+    | grep -Evx '(DESC\.in|SS|ZDR)')
+
+fail=
+
+for f in $psfonts
+do
+    printf "checking for font description %s...\n" "$f" >&2
+    if ! test -f "$devpdf_fontbuilddir"/"$f"
+    then
+        echo test -f "$devpdf_fontbuilddir"/"$f"
+        echo FAILED >&2
+        fail=yes
+    fi
+done
+
+test -z "$fail"
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/font/devpdf/tests/urw-fonts-present.sh 
b/font/devpdf/tests/urw-fonts-present.sh
new file mode 100755
index 00000000..67af0f96
--- /dev/null
+++ b/font/devpdf/tests/urw-fonts-present.sh
@@ -0,0 +1,79 @@
+#!/bin/sh
+#
+# Copyright (C) 2022 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+# Ensure that groff's PDF device has URW font descriptions it expects.
+
+devpdf_fontbuilddir="${abs_top_builddir:-.}"/font/devpdf
+
+# TODO: Scrape this list out of Foundry or Foundry.in.  Not possible
+# with grep, likely a little tedious with sed.
+urwfonts='AB
+ABI
+AI
+AR
+BMB
+BMBI
+BMI
+BMR
+CB
+CBI
+CI
+CR
+HB
+HBI
+HI
+HNB
+HNBI
+HNI
+HNR
+HR
+NB
+NBI
+NI
+NR
+PB
+PBI
+PI
+PR
+S
+TB
+TBI
+TI
+TR
+ZCMI
+ZD'
+
+fail=
+
+for basefontname in $urwfonts
+do
+    f=U-$basefontname
+    printf "checking for font description %s...\n" $f >&2
+    if ! test -f "$devpdf_fontbuilddir"/$f
+    then
+        echo test -f "$devpdf_fontbuilddir"/$f
+        echo FAILED >&2
+        fail=yes
+    fi
+done
+
+test -z "$fail"
+
+# vim:set ai et sw=4 ts=4 tw=72:



reply via email to

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