summaryrefslogtreecommitdiff
path: root/font
diff options
context:
space:
mode:
authorwl <wl>2011-08-10 18:22:58 +0000
committerwl <wl>2011-08-10 18:22:58 +0000
commita8a28d87bf78636f437d06712f80574f0c62dadb (patch)
tree4b32e3e506d127d6ac7142d62cdfbde84fc952e8 /font
parent0938acbb014e059439eabcd1688728e3bb00edaf (diff)
downloadgroff-a8a28d87bf78636f437d06712f80574f0c62dadb.tar.gz
[gropdf] Minor updates and fixes.
* src/devices/gropdf/gropdf.pl: Change command line option `-fy' to `-y' for consistency. Better support for Windows platform. (do_x): Handle keywords `pagename' and `switchtopage'. * doc/groff.texinfo, src/devices/gropdf/gropdf.man: Updated. * font/devpdf/Foundry: Renamed to... * font/devpdf/Foundry.in: This. Add default alias font names. * font/devpdf/util/BuildFoundries.pl: This is now an installation helper script and gets not longer installed. Support alternative font file names (separated with `!'). * font/devpdf/Makefile.sub: Fixes to work with a separate build directory. Font files are now build at `make' time; this makes `test-groff' work with -Tpdf. * font/devpdf/util/Makefile.sub: Removed. * Makefile.in (DEVDIRS, OTHERDIRS, EXTRADIRS): Handle devpdf specially.
Diffstat (limited to 'font')
-rw-r--r--font/devpdf/Makefile.sub81
-rw-r--r--font/devpdf/util/BuildFoundries.pl39
2 files changed, 77 insertions, 43 deletions
diff --git a/font/devpdf/Makefile.sub b/font/devpdf/Makefile.sub
index e61c6503..a40a13b6 100644
--- a/font/devpdf/Makefile.sub
+++ b/font/devpdf/Makefile.sub
@@ -17,10 +17,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
DEV=pdf
-GROFF_FONT_FILES=`cd $(DESTDIR)$(fontsubdir); \
- grep -l internalname * | grep -v Makefile.sub`
-ENC_FILES=`cd $(DESTDIR)$(fontsubdir); ls enc`
-MAP_FILES=`cd $(DESTDIR)$(fontsubdir); ls map`
+GROFF_FONT_FILES=`cd $(top_builddir)/font/devpdf \
+ && find * -maxdepth 0 -type f ! -name Makefile.sub \
+ -exec grep -l internalname {} \;`
+ENC_FILES=`cd $(top_builddir)/font/devpdf; ls enc/*`
+MAP_FILES=`cd $(top_builddir)/font/devpdf; ls map/*`
UTILFILES=\
BuildFoundries
@@ -28,14 +29,17 @@ UTILFILES=\
MOSTLYCLEANADD=\
download \
DESC \
+ Foundry \
util/BuildFoundries \
$(GROFF_FONT_FILES) \
$(ENC_FILES) \
$(MAP_FILES)
-#MOSTLYCLEANDIRADD=enc map
+
+MOSTLYCLEANDIRADD=enc map
DEVFILES=\
Foundry
+
#DEVSCRIPTS=util/BuildFoundries
DISTFILES=\
@@ -51,21 +55,53 @@ all: DESC BuildFoundries
DESC: DESC.in
-rm -f DESC
- cat $(srcdir)/DESC.in >DESC
+ cat $(srcdir)/DESC.in >$(top_builddir)/font/devpdf/DESC
if test "$(PAGE)" = A4; then \
- echo "papersize a4" >>DESC; \
+ echo "papersize a4" >>$(top_builddir)/font/devpdf/DESC; \
else \
- echo "papersize letter" >>DESC; \
+ echo "papersize letter" >>$(top_builddir)/font/devpdf/DESC; \
fi
+ -rm -f Foundry
+ cat $(srcdir)/Foundry.in >$(top_builddir)/font/devpdf/Foundry
BuildFoundries: util/BuildFoundries.pl $(SH_DEPS_SED_SCRIPT)
+ -test -d $(top_builddir)/font/devpdf/enc \
+ || $(mkinstalldirs) $(top_builddir)/font/devpdf/enc
+ -test -d $(top_builddir)/font/devpdf/map \
+ || $(mkinstalldirs) $(top_builddir)/font/devpdf/map
+ cp -f $(top_srcdir)/font/devps/text.enc \
+ $(top_builddir)/font/devpdf/enc
+ cp -f $(top_srcdir)/font/devps/symbolmap \
+ $(top_builddir)/font/devpdf/map
+ cp -f $(top_srcdir)/font/devps/generate/dingbats.map \
+ $(top_builddir)/font/devpdf/map
+ cp -f $(top_srcdir)/font/devps/generate/textmap \
+ $(top_builddir)/font/devpdf/map
+ cp -f $(top_srcdir)/font/devps/generate/symbolchars \
+ $(top_builddir)/font/devpdf/map
-test -d util || $(mkinstalldirs) util
$(RM) util/$@
+ if test -n "$(PERLPATH)"; then \
+ sed -f $(SH_DEPS_SED_SCRIPT) \
+ -e "s|/usr/bin/perl|$(PERLPATH)|" \
+ -e "s|@GROFF_GHOSTSCRIPT_INTERPRETERS@|$(GHOSTSCRIPT)|" \
+ -e "s|@VERSION@|$(version)$(revision)|" \
+ -e "s|@GROFF_FONT_DIR@|$(fontdir)|" \
+ $(srcdir)/util/BuildFoundries.pl \
+ >$(top_builddir)/font/devpdf/util/$@ ;\
+ else \
sed -f $(SH_DEPS_SED_SCRIPT) \
-e "s|@VERSION@|$(version)$(revision)|" \
- -e "s|@PERLPATH@|$(PERLPATH)|" \
- -e "s|@GROFF_FONT_DIR@|$(fontdir)|" $(srcdir)/util/BuildFoundries.pl > util/$@
+ -e "s|@GROFF_FONT_DIR@|$(fontdir)|" \
+ $(srcdir)/util/BuildFoundries.pl \
+ >$(top_builddir)/font/devpdf/util/$@ ;\
+ fi
chmod +x util/$@
+ echo "# foundry ps name psfile" > $(top_builddir)/font/devpdf/download
+ PATH="$(top_builddir)/src/utils/afmtodit:${GROFF_PATH_SEPARATOR}${PATH}" \
+ util/BuildFoundries $(top_builddir)/font/devpdf \
+ '$(top_srcdir)/font/devps : $(top_builddir)/font/devps' \
+ >> $(top_builddir)/font/devpdf/download
install_data:
-test -d $(DESTDIR)$(fontsubdir) \
@@ -83,25 +119,16 @@ install_data:
fi; \
done
$(RM) $@
- cp -f $(DESTDIR)$(fontdir)/devps/text.enc \
- $(DESTDIR)$(fontsubdir)/enc
- cp -f $(srcdir)/../devps/symbolmap \
- $(DESTDIR)$(fontsubdir)/map
- cp -f $(DESTDIR)$(fontdir)/devps/generate/dingbats.map \
- $(DESTDIR)$(fontsubdir)/map
- cp -f $(DESTDIR)$(fontdir)/devps/generate/textmap \
- $(DESTDIR)$(fontsubdir)/map
- cp -f $(DESTDIR)$(fontdir)/devps/generate/symbolchars \
- $(DESTDIR)$(fontsubdir)/map
- echo "# foundry ps name psfile" > $(DESTDIR)$(fontsubdir)/download
- util/BuildFoundries $(DESTDIR)$(fontsubdir) \
- > $(DESTDIR)$(fontsubdir)/download
uninstall_sub:
for f in $(MOSTLYCLEANADD); do \
$(RM) $(DESTDIR)$(fontsubdir)/$$f; \
done
- rmdir $(DESTDIR)$(fontsubdir)/enc
- rmdir $(DESTDIR)$(fontsubdir)/map
- rmdir $(DESTDIR)$(fontsubdir)/util
- rmdir $(DESTDIR)$(fontsubdir)
+ -test -d $(DESTDIR)$(fontsubdir)/enc \
+ && rmdir $(DESTDIR)$(fontsubdir)/enc
+ -test -d $(DESTDIR)$(fontsubdir)/map \
+ && rmdir $(DESTDIR)$(fontsubdir)/map
+ -test -d $(DESTDIR)$(fontsubdir)/util \
+ && rmdir $(DESTDIR)$(fontsubdir)/util
+ -test -d $(DESTDIR)$(fontsubdir) \
+ && rmdir $(DESTDIR)$(fontsubdir)
diff --git a/font/devpdf/util/BuildFoundries.pl b/font/devpdf/util/BuildFoundries.pl
index 80756147..8f52fd1d 100644
--- a/font/devpdf/util/BuildFoundries.pl
+++ b/font/devpdf/util/BuildFoundries.pl
@@ -1,7 +1,7 @@
-#!@PERLPATH@ -w
+#!/usr/bin/perl -w
#
-# BuildFoundries: Given a Foundry file generate groff and download files
-# Deri James: Monday 07 Feb 2011
+# BuildFoundries : Given a Foundry file generate groff and download files
+# Deri James : Monday 07 Feb 2011
# Copyright (C) 2011 Free Software Foundation, Inc.
# Written by Deri James <deri@chuzzlewit.demon.co.uk>
@@ -24,6 +24,7 @@
use strict;
my $where=shift||'';
+my $devps=shift||'../devps';
chdir $where if $where ne '';
my (%foundry,%flg,@downloadpreamble,%download);
my $GSpath=FindGSpath();
@@ -38,6 +39,7 @@ WriteDownload("download");
exit $warn;
+
sub LoadFoundry
{
my $fn=shift;
@@ -67,7 +69,8 @@ sub LoadFoundry
if (lc($r[0]) eq 'foundry')
{
$foundry=uc($r[1]);
- $foundrypath=$r[2];
+ $foundrypath=$r[2].' : '.$devps;
+ $foundrypath=~s/\(gs\)/$GSpath /;
}
else
{
@@ -92,10 +95,11 @@ sub LoadFoundry
# Don't run afmtodit, just copy the grops font file
my $gotf=1;
+ my $gropsfnt=LocateFile($devps,$r[0],0);
- if (-r "../devps/$r[0]")
+ if ($gropsfnt ne '' and -r "$gropsfnt")
{
- my $psfont=UseGropsVersion($r[0]);
+ my $psfont=UseGropsVersion($gropsfnt);
if (!PutDownload($psfont,LocatePF($foundrypath,$r[5]),uc($r[1])))
{
if (uc($r[1]) ne 'Y')
@@ -106,6 +110,7 @@ sub LoadFoundry
}
}
print STDERR "Copied grops font $gfont...\n" if $gotf;
+
}
else
{
@@ -211,9 +216,11 @@ sub LocatePF
sub LocateFile
{
my $path=shift;
- my $file=shift;
+ my $files=shift;
my $tryafm=shift;
+ foreach my $file (split('!',$files))
+ {
if ($file=~m'/')
{
# path given with file name so no need to search the paths
@@ -234,11 +241,7 @@ sub LocateFile
return('');
}
- if ($path eq '(gs)')
- {
- $path=$GSpath;
- }
- elsif ($path eq '(tex)')
+ if ($path eq '(tex)')
{
my $res=`kpsewhich $file`;
return '' if $?;
@@ -246,10 +249,11 @@ sub LocateFile
return($res);
}
- my (@paths)=split(':',$path);
+ my (@paths)=split(/ (:|;)/,$path);
foreach my $p (@paths)
{
+ next if !defined($p) or $p eq ';' or $p eq ':';
$p=~s/^\s+//;
$p=~s/\s+$//;
@@ -268,13 +272,14 @@ sub LocateFile
}
}
}
+ }
return('');
}
sub FindGSpath
{
- my (@res)=`gs -h 2>/dev/null`;
+ my (@res)=`@GROFF_GHOSTSCRIPT_INTERPRETERS@ -h 2>/dev/null`;
return '' if $?;
my $buildpath='';
my $stg=1;
@@ -308,8 +313,10 @@ sub UseGropsVersion
{
my $gfont=shift;
my $psfont='';
+ my (@gfa)=split('/',$gfont);
+ my $gfontbase=pop(@gfa);
- if (open(GF,"<../devps/$gfont"))
+ if (open(GF,"<$gfont"))
{
my (@gf)=(<GF>);
my @ps=grep(/^internalname /,@gf);
@@ -327,7 +334,7 @@ sub UseGropsVersion
if ($psfont)
{
- if (open(GF,">$gfont"))
+ if (open(GF,">$gfontbase"))
{
local $"='';
print GF "@gf";