diff options
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | font/devpdf/devpdf.am | 9 | ||||
-rwxr-xr-x | font/devpdf/tests/basic-fonts-present.sh | 47 | ||||
-rwxr-xr-x | font/devpdf/tests/urw-fonts-present.sh | 79 |
4 files changed, 148 insertions, 0 deletions
@@ -1,5 +1,18 @@ 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 symbol.map lives in the "devpdf/generate" directory along with the other map files, it doesn't need a dedicated Makefile target diff --git a/font/devpdf/devpdf.am b/font/devpdf/devpdf.am index b2eecfac0..663774f01 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 000000000..5b55ed5ef --- /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 000000000..67af0f967 --- /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: |