From 409da5b5619677a32b2c2cf22c6751959f92f876 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 25 Apr 2017 20:32:39 -0700 Subject: [PATCH] Windows portability: fix construct in findfont.ph, README update Fix a construct in doc/findfont.ph which crashes Perl on Windows unconditionally. Improve the README for building the full package with MSVC. Signed-off-by: H. Peter Anvin --- Mkfiles/README | 15 ++++++++++----- doc/findfont.ph | 9 ++++++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Mkfiles/README b/Mkfiles/README index 4cca802e..dfaea113 100644 --- a/Mkfiles/README +++ b/Mkfiles/README @@ -13,16 +13,21 @@ The Makefiles are: If the following tools are installed, the full installer package can be built: - 1. Perl (5.6 or later) - 2. Nullsoft Scriptable Installer System (makensis) + 1. Perl (5.6 or later), e.g. ActivePerl or StrawberryPerl + http://strawberryperl.com/ + 2. Nullsoft Scriptable Install System (makensis) + http://nsis.sourceforge.net/Download 3. Ghostscript (ps2pdf) or Acrobat Distriller (acrodist) + https://downloads.ghostscript.com/ 4. The Adobe Source Sans Pro and Source Code Pro fonts - 5. The Perl module Font::TTF - + https://github.com/adobe-fonts + 5. The Perl module Font::TTF (can usually be installed + via the "CPAN Client" in your Perl distribution) + http://search.cpan.org/~bhallissy/Font-TTF/ The tools need to be in your current path. To build the installer package, run: - nmake /f Mkfiles\msvc.mak nsis + nmake /f Mkfiles\msvc.mak everything nsis Filename Target Compiler Tested with --------------------------------------------------------------------------- diff --git a/doc/findfont.ph b/doc/findfont.ph index db9dd9dd..8fa81dfb 100644 --- a/doc/findfont.ph +++ b/doc/findfont.ph @@ -132,10 +132,13 @@ sub findfont($) { } # Are we on a system that uses fontconfig? + # NOTE: use a single string for the command here, or this + # script dies horribly on Windows, even though this isn't really + # applicable there... if (!defined($file) && - open(my $fh, '-|', 'fc-match', - '-f', '%{file}\n%{postscriptname}\n', - " : postscriptname=$fontname")) { + open(my $fh, '-|', + "fc-match -f \"%{file}\\n%{postscriptname}\\n\" ". + "\" : postscriptname=$fontname\"") { chomp($file = <$fh>); chomp($psname = <$fh>); close($fh);