diff --git a/configure.ac b/configure.ac
index 981be018..05585159 100644
--- a/configure.ac
+++ b/configure.ac
@@ -161,6 +161,9 @@ GROFF_TRADITIONAL_CPP
 # checks for operating system services
 GROFF_WCOREFLAG
 
+# URW fonts extra dir
+GROFF_URW_FONTS_PATH
+
 # other random stuff
 GROFF_BROKEN_SPOOLER_FLAGS
 GROFF_PAGE
@@ -178,6 +181,10 @@ GROFF_BASH
 gl_GLIBC21
 gl_LOCALCHARSET
 
+# checks for presence of URW fonts (requires ghostscript, which is
+# checked in GROFF_HTML_PROGRAMS
+GROFF_URW_FONTS
+
 AM_CONDITIONAL([BUILD_WINSCRIPTS], [test -n "$make_winscripts"])
 
 # If X11 is not available, don't build:
@@ -230,6 +237,9 @@ echo "\
  Doc build         : ${doc} "
 fi
 echo "\
+ URW fonts for pdf : $groff_have_urw_fonts"
+echo "\
 ----------------------------------------------------------------------"
 
 GROFF_APPRESDIR_CHECK
+GROFF_URW_FONTS_CHECK
diff --git a/font/devpdf/Foundry.in b/font/devpdf/Foundry.in
index a6e968f7..092617ee 100644
--- a/font/devpdf/Foundry.in
+++ b/font/devpdf/Foundry.in
@@ -25,47 +25,47 @@ foundry||(gs)
 # These are just copies of the grops fonts so MUST not have any flags etc set
 
 #Font|IsBase14|Flags|Map|Encoding|File(!file...)
-AB|N||||URWGothicL-Demi!a010015l.pfb
-ABI|N||||URWGothicL-DemiObli!a010035l.pfb
-AI|N||||URWGothicL-BookObli!a010033l.pfb
-AR|N||||URWGothicL-Book!a010013l.pfb
-BMB|N||||URWBookmanL-DemiBold!b018015l.pfb
-BMBI|N||||URWBookmanL-DemiBoldItal!b018035l.pfb
-BMI|N||||URWBookmanL-LighItal!b018032l.pfb
-BMR|N||||URWBookmanL-Ligh!b018012l.pfb
-CB|Y||||NimbusMonL-Bold!n022004l.pfb
-CBI|Y||||NimbusMonL-BoldObli!n022024l.pfb
-CI|Y||||NimbusMonL-ReguObli!n022023l.pfb
-CR|Y||||NimbusMonL-Regu!n022003l.pfb
+AB|N||||URWGothic-Demi!URWGothicL-Demi!a010015l.pfb
+ABI|N||||URWGothic-DemiOblique!URWGothicL-DemiObli!a010035l.pfb
+AI|N||||URWGothic-BookOblique!URWGothicL-BookObli!a010033l.pfb
+AR|N||||URWGothic-Book!URWGothicL-Book!a010013l.pfb
+BMB|N||||URWBookman-Demi!URWBookmanL-DemiBold!b018015l.pfb
+BMBI|N||||URWBookman-DemiItalic!URWBookmanL-DemiBoldItal!b018035l.pfb
+BMI|N||||URWBookman-Light!URWBookmanL-LighItal!b018032l.pfb
+BMR|N||||URWBookman-LightItalic!URWBookmanL-Ligh!b018012l.pfb
+CB|Y||||NimbusMonoPS-Bold!NimbusMonL-Bold!n022004l.pfb
+CBI|Y||||NifmbusMonoPS-BoldItalic!NimbusMonL-BoldObli!n022024l.pfb
+CI|Y||||NimbusMonoPS-Italic!NimbusMonL-ReguObli!n022023l.pfb
+CR|Y||||NimbusMonoPS-Regular!NimbusMonL-Regu!n022003l.pfb
 EURO|N||||*../devps/freeeuro.pfa
-HB|Y||||NimbusSanL-Bold!n019004l.pfb
-HBI|Y||||NimbusSanL-BoldItal!n019024l.pfb
-HI|Y||||NimbusSanL-ReguItal!n019023l.pfb
-HNB|N||||NimbusSanL-BoldCond!n019044l.pfb
-HNBI|N||||NimbusSanL-BoldCondItal!n019064l.pfb
-HNI|N||||NimbusSanL-ReguCondItal!n019063l.pfb
-HNR|N||||NimbusSanL-ReguCond!n019043l.pfb
-HR|Y||||NimbusSanL-Regu!n019003l.pfb
-NB|N||||CenturySchL-Bold!c059016l.pfb
-NBI|N||||CenturySchL-BoldItal!c059036l.pfb
-NI|N||||CenturySchL-Ital!c059033l.pfb
-NR|N||||CenturySchL-Roma!c059013l.pfb
-PB|N||||URWPalladioL-Bold!p052004l.pfb
-PBI|N||||URWPalladioL-BoldItal!p052024l.pfb
-PI|N||||URWPalladioL-Ital!p052023l.pfb
-PR|N||||URWPalladioL-Roma!p052003l.pfb
-S|Y||||StandardSymL!s050000l.pfb
-TB|Y||||NimbusRomNo9L-Medi!n021004l.pfb
-TBI|Y||||NimbusRomNo9L-MediItal!n021024l.pfb
-TI|Y||||NimbusRomNo9L-ReguItal!n021023l.pfb
-TR|Y||||NimbusRomNo9L-Regu!n021003l.pfb
-ZCMI|N||||URWChanceryL-MediItal!z003034l.pfb
+HB|Y||||NimbusSans-Bold!NimbusSanL-Bold!n019004l.pfb
+HBI|Y||||NimbusSans-BoldOblique!NimbusSanL-BoldItal!n019024l.pfb
+HI|Y||||NimbusSans-Oblique!NimbusSanL-ReguItal!n019023l.pfb
+HNB|N||||NimbusSansNarrow-Bold!NimbusSanL-BoldCond!n019044l.pfb
+HNBI|N||||NimbusSansNarrow-BdOblique!NimbusSanL-BoldCondItal!n019064l.pfb
+HNI|N||||NimbusSansNarrow-Oblique!NimbusSanL-ReguCondItal!n019063l.pfb
+HNR|N||||NimbusSansNarrow-Regular!NimbusSanL-ReguCond!n019043l.pfb
+HR|Y||||NimbusSans-Regular!NimbusSans-Regular!NimbusSanL-Regu!n019003l.pfb
+NB|N||||C059-Bold!CenturySchL-Bold!c059016l.pfb
+NBI|N||||C059-BdIta!CenturySchL-BoldItal!c059036l.pfb
+NI|N||||C059-Italic!CenturySchL-Ital!c059033l.pfb
+NR|N||||C059-Roman!CenturySchL-Roma!c059013l.pfb
+PB|N||||P052-Bold!URWPalladioL-Bold!p052004l.pfb
+PBI|N||||P052-BoldItalic!URWPalladioL-BoldItal!p052024l.pfb
+PI|N||||P052-Italic!URWPalladioL-Ital!p052023l.pfb
+PR|N||||P052-Roman!URWPalladioL-Roma!p052003l.pfb
+S|Y||||StandardSymbolsPS!StandardSymL!s050000l.pfb
+TB|Y||||NimbusRoman-Bold!NimbusRomNo9L-Medi!n021004l.pfb
+TBI|Y||||NimbusRoman-BoldItalic!NimbusRomNo9L-MediItal!n021024l.pfb
+TI|Y||||NimbusRoman-Italic!NimbusRomNo9L-ReguItal!n021023l.pfb
+TR|Y||||NimbusRoman-Regular!NimbusRomNo9L-Regu!n021003l.pfb
+ZCMI|N||||Z003-MediumItalic!URWChanceryL-MediItal!z003034l.pfb
 ZD|Y||||Dingbats!d050000l.pfb
 
 #======================================================================
 
 #Foundry|Name|Searchpath
-foundry|U|(gs):/usr/share/fonts/type1/gsfonts :/opt/local/share/fonts/urw-fonts # the URW fonts delivered with ghostscript (may be different)
+foundry|U|(gs):@urwfontsdir@ :/usr/share/fonts/type1/gsfonts :/opt/local/share/fonts/urw-fonts # the URW fonts delivered with ghostscript (may be different)
 #Define Flags for afmtodit
 
 r=-i 0 -m
diff --git a/font/devpdf/devpdf.am b/font/devpdf/devpdf.am
index 067da3fd..907465c3 100644
--- a/font/devpdf/devpdf.am
+++ b/font/devpdf/devpdf.am
@@ -106,7 +106,7 @@ font/devpdf/DESC: $(devpdf_srcdir)/DESC.in
 
 font/devpdf/Foundry:
 	@$(RM) $(top_builddir)/font/devpdf/Foundry
-	@cat $(devpdf_srcdir)/Foundry.in >$(top_builddir)/font/devpdf/Foundry
+	@sed "s|[@]urwfontsdir[@]|$(urwfontsdir)|" $(devpdf_srcdir)/Foundry.in >$(top_builddir)/font/devpdf/Foundry
 
 all: font/devpdf/build_font_files
 
diff --git a/m4/groff.m4 b/m4/groff.m4
index 75049e6b..89b3cacb 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -1,5 +1,5 @@
 # Autoconf macros for groff.
-# Copyright (C) 1989-2014  Free Software Foundation, Inc.
+# Copyright (C) 1989-2016, 2017  Free Software Foundation, Inc.
 #
 # This file is part of groff.
 #
@@ -322,6 +322,62 @@ AC_DEFUN([GROFF_PDFDOC_PROGRAMS],
    AC_SUBST([make_install_pdfexamples])
    AC_SUBST([make_uninstall_pdfexamples])])
 
+# Option to configure path to URW fonts
+AC_DEFUN([GROFF_URW_FONTS_PATH],
+   [AC_ARG_WITH([urw-fonts-dir],
+     [AS_HELP_STRING([--with-urw-fonts-dir=DIR],
+       [Search for URW fonts in this directory])],
+     [urwfontsdir="$withval"])
+   AC_SUBST(urwfontsdir)])
+
+# Check if URW fonts are available, either in the paths given by 'gs
+# -h', in /usr/share/fonts/type1/gsfonts/ ,
+# /opt/local/share/fonts/urw-fonts (where font/devpdf/Foundry.in
+# expect them), or in the custom path passed to configure.
+AC_DEFUN([GROFF_URW_FONTS],
+  [AC_MSG_CHECKING([whether URW fonts in pfb format are available])
+  _list_paths=`gs -h | grep -A 16 "Search path" | grep "^[ ]" | tr : ' ' `
+  _list_paths="$_list_paths /usr/share/fonts/type1/gsfonts/ \
+               /opt/local/share/fonts/urw-fonts/"
+  if test -n "$urwfontsdir"; then
+    _list_paths="$ _list_paths $urwfontsdir"
+  fi
+  groff_have_urw_fonts=no
+  for k in $_list_paths; do
+    if test -f $k/a010013l.pfb; then
+      AC_MSG_RESULT([found in $k])
+      groff_have_urw_fonts=yes
+      break
+    fi
+  done 
+  if test $groff_have_urw_fonts = no; then
+    AC_MSG_RESULT([no])
+  fi
+  ])
+
+# Warning if URW fonts were not found
+AC_DEFUN([GROFF_URW_FONTS_CHECK],
+  [if test "$groff_have_urw_fonts" = no; then
+  AC_MSG_NOTICE([
+  No URW fonts in .pfb format were found on your system, URW fonts
+  generation for 'devpdf' will not work properly.  These fonts can be
+  downloaded here:
+
+    http://downloads.ghostscript.com/public/fonts/urw-base35-v1.10.zip
+
+  By default groff will search these fonts in the paths given by 'gs
+  -h' and in these 2 default directories:
+  '/usr/share/fonts/type1/gsfonts/' and
+  '/opt/local/share/fonts/urw-fonts/' (paths used by
+  font/devpdf/Foundry.in).  You can also pass the option
+  '--with-urw-fonts-dir=DIR' to 'configure' to set a custom path.  You
+  would need to re-run the 'configure' script after installing these
+  fonts.
+  
+  ])
+  fi
+  ])
+
 
 # Check whether pnmtops can handle the -nosetpage option.
 
