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 <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2017-04-25 20:32:39 -07:00
parent 35915aec7f
commit 409da5b561
2 changed files with 16 additions and 8 deletions

View File

@ -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
---------------------------------------------------------------------------

View File

@ -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);