diff --git a/libwmf-0.2.8.4.newurwfonts.patch b/libwmf-0.2.8.4.newurwfonts.patch
new file mode 100644
index 0000000..a1c7102
--- /dev/null
+++ b/libwmf-0.2.8.4.newurwfonts.patch
@@ -0,0 +1,83 @@
+diff -ru libwmf-0.2.8.4/fonts/fontmap.in libwmf-0.2.8.4.fixed/fonts/fontmap.in
+--- libwmf-0.2.8.4/fonts/fontmap.in 2001-08-11 15:49:27.000000000 +0100
++++ libwmf-0.2.8.4.fixed/fonts/fontmap.in 2018-08-08 11:45:23.199731396 +0100
+@@ -1,16 +1,16 @@
+
+
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
++
++
++
++
++
++
++
++
++
++
++
++
++
+
+diff -ru libwmf-0.2.8.4/configure.in libwmf-0.2.8.4.fixed/configure.in
+--- libwmf-0.2.8.4/configure.in 2018-08-08 11:59:17.657412141 +0100
++++ libwmf-0.2.8.4.fixed/configure.in 2018-08-08 12:00:28.976983132 +0100
+@@ -804,7 +804,9 @@
+ WMF_GS_FONTMAP=/usr/share/ghostscript/5.50/Fontmap
+ if test -d /usr/share/ghostscript; then
+ for i in `ls /usr/share/ghostscript`; do
+- if test -r "/usr/share/ghostscript/$i/Fontmap.GS"; then
++ if test -r "/usr/share/ghostscript/$i/Resource/Init/Fontmap.GS"; then
++ WMF_GS_FONTMAP="/usr/share/ghostscript/$i/Resource/Init/Fontmap.GS"
++ elif test -r "/usr/share/ghostscript/$i/Fontmap.GS"; then
+ WMF_GS_FONTMAP="/usr/share/ghostscript/$i/Fontmap.GS"
+ elif test -r "/usr/share/ghostscript/$i/Fontmap"; then
+ WMF_GS_FONTMAP="/usr/share/ghostscript/$i/Fontmap"
+diff -ru libwmf-0.2.8.4/src/font.h libwmf-0.2.8.4.fixed/src/font.h
+--- libwmf-0.2.8.4/src/font.h 2018-08-08 12:03:52.099609351 +0100
++++ libwmf-0.2.8.4.fixed/src/font.h 2018-08-08 12:07:02.888112396 +0100
+@@ -80,19 +80,19 @@
+ /* postscript (standard 13) font name mapping to type 1 font file
+ */
+ static wmfMapping PSFontMap[13] = {
+- { "Courier", "n022003l.pfb", ft_encoding_adobe_standard },
+- { "Courier-Oblique", "n022023l.pfb", ft_encoding_adobe_standard },
+- { "Courier-Bold", "n022004l.pfb", ft_encoding_adobe_standard },
+- { "Courier-BoldOblique", "n022024l.pfb", ft_encoding_adobe_standard },
+- { "Helvetica", "n019003l.pfb", ft_encoding_adobe_standard },
+- { "Helvetica-Oblique", "n019023l.pfb", ft_encoding_adobe_standard },
+- { "Helvetica-Bold", "n019004l.pfb", ft_encoding_adobe_standard },
+- { "Helvetica-BoldOblique","n019024l.pfb", ft_encoding_adobe_standard },
+- { "Times-Roman", "n021003l.pfb", ft_encoding_adobe_standard },
+- { "Times-Italic", "n021023l.pfb", ft_encoding_adobe_standard },
+- { "Times-Bold", "n021004l.pfb", ft_encoding_adobe_standard },
+- { "Times-BoldItalic", "n021024l.pfb", ft_encoding_adobe_standard },
+- { "Symbol", "s050000l.pfb", ft_encoding_adobe_custom }};
++ { "Courier", "NimbusMonoPS-Regular.t1", ft_encoding_adobe_standard },
++ { "Courier-Oblique", "NimbusMonoPS-Italic.t1", ft_encoding_adobe_standard },
++ { "Courier-Bold", "NimbusMonoPS-Bold.t1", ft_encoding_adobe_standard },
++ { "Courier-BoldOblique", "NimbusMonoPS-BoldItalic.t1", ft_encoding_adobe_standard },
++ { "Helvetica", "NimbusSans-Regular.t1", ft_encoding_adobe_standard },
++ { "Helvetica-Oblique", "NimbusSans-Italic.t1", ft_encoding_adobe_standard },
++ { "Helvetica-Bold", "NimbusSans-Bold.t1", ft_encoding_adobe_standard },
++ { "Helvetica-BoldOblique","NimbusSans-BoldItalic.t1", ft_encoding_adobe_standard },
++ { "Times-Roman", "NimbusRoman-Regular.t1", ft_encoding_adobe_standard },
++ { "Times-Italic", "NimbusRoman-Italic.t1", ft_encoding_adobe_standard },
++ { "Times-Bold", "NimbusRoman-Bold.t1", ft_encoding_adobe_standard },
++ { "Times-BoldItalic", "NimbusRoman-BoldItalic.t1", ft_encoding_adobe_standard },
++ { "Symbol", "StandardSymbolsPS.t1", ft_encoding_adobe_custom }};
+
+ /* exact WMF font name to postscript (standard 13) equivalent...
+ * well, yeah, I know. :-(
diff --git a/libwmf.spec b/libwmf.spec
index b26303e..13112ee 100644
--- a/libwmf.spec
+++ b/libwmf.spec
@@ -1,7 +1,7 @@
Summary: Windows MetaFile Library
Name: libwmf
Version: 0.2.8.4
-Release: 55%{?dist}
+Release: 56%{?dist}
Group: System Environment/Libraries
#libwmf is under the LGPLv2+, however...
#1. The tarball contains an old version of the urw-fonts under GPL+.
@@ -73,6 +73,8 @@ Patch23: libwmf-0.2.8.4-CVE-2016-10167.patch
Patch24: libwmf-0.2.8.4-CVE-2016-10168.patch
# CVE-2017-6362
Patch25: libwmf-0.2.8.4-CVE-2017-6362.patch
+# rhbz#1595490
+Patch26: libwmf-0.2.8.4.newurwfonts.patch
Requires: urw-fonts
Requires: %{name}-lite = %{version}-%{release}
@@ -131,13 +133,14 @@ using libwmf.
%patch23 -p1 -b .CVE-2016-10167
%patch24 -p1 -b .CVE-2016-10168
%patch25 -p1 -b .CVE-2017-6362
+%patch26 -p1 -b .newurwfonts
f=README ; iconv -f iso-8859-2 -t utf-8 $f > $f.utf8 ; mv $f.utf8 $f
%build
rm configure.ac
ln -s patches/acconfig.h acconfig.h
autoreconf -i -f
-%configure --with-libxml2 --disable-static --disable-dependency-tracking
+%configure --with-libxml2 --disable-static --disable-dependency-tracking --with-gsfontdir=/usr/share/fonts/urw-base35
make %{?_smp_mflags}
dos2unix doc/caolan/*.html
@@ -151,7 +154,7 @@ find doc -name "Makefile*" -exec rm {} \;
#we're carrying around duplicate fonts
rm -rf $RPM_BUILD_ROOT%{_datadir}/libwmf/fonts/*afm
rm -rf $RPM_BUILD_ROOT%{_datadir}/libwmf/fonts/*pfb
-sed -i $RPM_BUILD_ROOT%{_datadir}/libwmf/fonts/fontmap -e 's#libwmf/fonts#fonts/default/Type1#g'
+sed -i $RPM_BUILD_ROOT%{_datadir}/libwmf/fonts/fontmap -e 's#libwmf/fonts#fonts/urw-base35#g'
%post -p /sbin/ldconfig
@@ -189,6 +192,9 @@ sed -i $RPM_BUILD_ROOT%{_datadir}/libwmf/fonts/fontmap -e 's#libwmf/fonts#fonts/
%changelog
+* Wed Aug 08 2018 Caolán McNamara - 0.2.8.4-56
+- Resolves: rhbz#1595490 make libwmf work again with recent urw-fonts
+
* Fri Jul 13 2018 Fedora Release Engineering - 0.2.8.4-55
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild