Resolves: rhbz#1595490 make libwmf work again with recent urw-fonts

This commit is contained in:
Caolán McNamara 2018-08-08 12:12:50 +01:00
parent cd46b208b7
commit 467dce2025
2 changed files with 92 additions and 3 deletions

View File

@ -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 @@
<?xml version="1.0"?>
<fontmap>
- <font format="type1" metrics="@WMF_FONTDIR@/n019003l.afm" glyphs="@WMF_FONTDIR@/n019003l.pfb" name="Helvetica" fullname="Helvetica Regular" familyname="Helvetica" weight="Regular" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n019004l.afm" glyphs="@WMF_FONTDIR@/n019004l.pfb" name="Helvetica-Bold" fullname="Helvetica Bold" familyname="Helvetica" weight="Bold" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n019023l.afm" glyphs="@WMF_FONTDIR@/n019023l.pfb" name="Helvetica-Oblique" fullname="Helvetica Regular Italic" familyname="Helvetica" weight="Regular" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n019024l.afm" glyphs="@WMF_FONTDIR@/n019024l.pfb" name="Helvetica-BoldOblique" fullname="Helvetica Bold Italic" familyname="Helvetica" weight="Bold" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n021003l.afm" glyphs="@WMF_FONTDIR@/n021003l.pfb" name="Times-Roman" fullname="Times Regular" familyname="Times" weight="Regular" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n021004l.afm" glyphs="@WMF_FONTDIR@/n021004l.pfb" name="Times-Bold" fullname="Times Medium" familyname="Times" weight="Bold" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n021023l.afm" glyphs="@WMF_FONTDIR@/n021023l.pfb" name="Times-Italic" fullname="Times Regular Italic" familyname="Times" weight="Regular" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n021024l.afm" glyphs="@WMF_FONTDIR@/n021024l.pfb" name="Times-BoldItalic" fullname="Times Medium Italic" familyname="Times" weight="Bold" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n022003l.afm" glyphs="@WMF_FONTDIR@/n022003l.pfb" name="Courier" fullname="Courier Regular" familyname="Courier" weight="Regular" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n022004l.afm" glyphs="@WMF_FONTDIR@/n022004l.pfb" name="Courier-Bold" fullname="Courier Bold" familyname="Courier" weight="Bold" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n022023l.afm" glyphs="@WMF_FONTDIR@/n022023l.pfb" name="Courier-Oblique" fullname="Courier Regular Oblique" familyname="Courier" weight="Regular" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/n022024l.afm" glyphs="@WMF_FONTDIR@/n022024l.pfb" name="Courier-BoldOblique" fullname="Courier Bold Oblique" familyname="Courier" weight="Bold" version="0.1"/>
- <font format="type1" metrics="@WMF_FONTDIR@/s050000l.afm" glyphs="@WMF_FONTDIR@/s050000l.pfb" name="Symbol" fullname="Symbol" familyname="Symbol" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusSans-Regular.afm" glyphs="@WMF_FONTDIR@/NimbusSans-Regular.t1" name="Helvetica" fullname="Helvetica Regular" familyname="Helvetica" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusSans-Bold.afm" glyphs="@WMF_FONTDIR@/NimbusSans-Bold.t1" name="Helvetica-Bold" fullname="Helvetica Bold" familyname="Helvetica" weight="Bold" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusSans-Italic.afm" glyphs="@WMF_FONTDIR@/NimbusSans-Italic.t1" name="Helvetica-Oblique" fullname="Helvetica Regular Italic" familyname="Helvetica" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusSans-BoldItalic.afm" glyphs="@WMF_FONTDIR@/NimbusSans-BoldItalic.t1" name="Helvetica-BoldOblique" fullname="Helvetica Bold Italic" familyname="Helvetica" weight="Bold" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusRoman-Regular.afm" glyphs="@WMF_FONTDIR@/NimbusRoman-Regular.t1" name="Times-Roman" fullname="Times Regular" familyname="Times" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusRoman-Bold.afm" glyphs="@WMF_FONTDIR@/NimbusRoman-Bold.t1" name="Times-Bold" fullname="Times Medium" familyname="Times" weight="Bold" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusRoman-Italic.afm" glyphs="@WMF_FONTDIR@/NimbusRoman-Italic.t1" name="Times-Italic" fullname="Times Regular Italic" familyname="Times" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusRoman-BoldItalic.afm" glyphs="@WMF_FONTDIR@/NimbusRoman-BoldItalic.t1" name="Times-BoldItalic" fullname="Times Medium Italic" familyname="Times" weight="Bold" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusMonoPS-Regular.afm" glyphs="@WMF_FONTDIR@/NimbusMonoPS-Regular.t1" name="Courier" fullname="Courier Regular" familyname="Courier" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusMonoPS-Bold.afm" glyphs="@WMF_FONTDIR@/NimbusMonoPS-Bold.t1" name="Courier-Bold" fullname="Courier Bold" familyname="Courier" weight="Bold" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusMonoPS-Italic.afm" glyphs="@WMF_FONTDIR@/NimbusMonoPS-Italic.t1" name="Courier-Oblique" fullname="Courier Regular Oblique" familyname="Courier" weight="Regular" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/NimbusMonoPS-BoldItalic.afm" glyphs="@WMF_FONTDIR@/NimbusMonoPS-BoldItalic.t1" name="Courier-BoldOblique" fullname="Courier Bold Oblique" familyname="Courier" weight="Bold" version="0.1"/>
+ <font format="type1" metrics="@WMF_FONTDIR@/StandardSymbolsPS.afm" glyphs="@WMF_FONTDIR@/StandardSymbolsPS.t1" name="Symbol" fullname="Symbol" familyname="Symbol" weight="Regular" version="0.1"/>
</fontmap>
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. :-(

View File

@ -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 <caolanm@redhat.com> - 0.2.8.4-56
- Resolves: rhbz#1595490 make libwmf work again with recent urw-fonts
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.8.4-55
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild