summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-10-14 13:50:47 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-10-14 13:50:47 +0000
commit7fe4a3ce82a1e70e8be1d44c89fd67f853b91fe1 (patch)
treeda1607cc6dd59f701ba87872c243207740d8b326
parent4b3f75dbeaa061449261771b6978a283068916ff (diff)
texk/ps2pkm: Bug fix and a new test
git-svn-id: svn://tug.org/texlive/trunk@35371 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/ps2pkm/ChangeLog8
-rw-r--r--Build/source/texk/ps2pkm/Makefile.am9
-rw-r--r--Build/source/texk/ps2pkm/Makefile.in19
-rwxr-xr-xBuild/source/texk/ps2pkm/configure45
-rw-r--r--Build/source/texk/ps2pkm/configure.ac3
-rw-r--r--Build/source/texk/ps2pkm/fontfcn.c2
-rw-r--r--Build/source/texk/ps2pkm/paths.c15
-rw-r--r--Build/source/texk/ps2pkm/spaces.c2
-rwxr-xr-xBuild/source/texk/ps2pkm/tests/lmmath.test23
-rw-r--r--Build/source/texk/ps2pkm/tests/lmmi12.600pkbin0 -> 18700 bytes
10 files changed, 111 insertions, 15 deletions
diff --git a/Build/source/texk/ps2pkm/ChangeLog b/Build/source/texk/ps2pkm/ChangeLog
index 19b6d5940d3..f7fadb079da 100644
--- a/Build/source/texk/ps2pkm/ChangeLog
+++ b/Build/source/texk/ps2pkm/ChangeLog
@@ -1,3 +1,11 @@
+2014-10-14 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * paths.c: Fixed a bug introduced by the previous "Bug fix".
+
+ * tests/lmmath.test: Shell script ...
+ * tests/lmmi12.600pk: ... and data for a new test.
+ * Makefile.am, configure.ac: Add the new test.
+
2014-10-13 Peter Breitenlohner <peb@mppmu.mpg.de>
* paths.c: Bug fix: Avoid use of uninitialized variable.
diff --git a/Build/source/texk/ps2pkm/Makefile.am b/Build/source/texk/ps2pkm/Makefile.am
index f2421c35a7d..188219dd53a 100644
--- a/Build/source/texk/ps2pkm/Makefile.am
+++ b/Build/source/texk/ps2pkm/Makefile.am
@@ -99,12 +99,17 @@ dist_man1_MANS = mag.1 pfb2pfa.1 pk2bm.1 ps2pk.1
## Tests.
##
-TESTS = tests/ps2pk.test
+TESTS_ENVIRONMENT = KPSEWHICH='$(KPSEWHICH)'
+TESTS = tests/lmmath.test tests/ps2pk.test
EXTRA_DIST = $(TESTS)
+DISTCLEANFILES =
+## tests/lmmath.test
+EXTRA_DIST += tests/lmmi12.600pk
+DISTCLEANFILES += lmmi12.600pk
## tests/ps2pk.test
EXTRA_DIST += tests/Symbol.afm tests/Symbol.alpha.hex tests/Symbol.alpha.pix \
tests/Symbol.pfa tests/Symbol.pfb tests/Symbol10.300pk
-DISTCLEANFILES = Symbol*
+DISTCLEANFILES += Symbol*
## Not used
##
diff --git a/Build/source/texk/ps2pkm/Makefile.in b/Build/source/texk/ps2pkm/Makefile.in
index e78f1ca0e31..6f0e79cf45d 100644
--- a/Build/source/texk/ps2pkm/Makefile.in
+++ b/Build/source/texk/ps2pkm/Makefile.in
@@ -468,6 +468,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KPATHSEA_DEPEND = @KPATHSEA_DEPEND@
KPATHSEA_INCLUDES = @KPATHSEA_INCLUDES@
KPATHSEA_LIBS = @KPATHSEA_LIBS@
+KPSEWHICH = @KPSEWHICH@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
@@ -637,14 +638,16 @@ ps2pk_SOURCES = \
util.h
dist_man1_MANS = mag.1 pfb2pfa.1 pk2bm.1 ps2pk.1
-TESTS = tests/ps2pk.test
-EXTRA_DIST = $(TESTS) tests/Symbol.afm tests/Symbol.alpha.hex \
- tests/Symbol.alpha.pix tests/Symbol.pfa tests/Symbol.pfb \
- tests/Symbol10.300pk CHANGES.type1 INSTALLATION README.14m \
- README.type1 basename.c flisearch.c pktest.c protos.h \
- psearch.c sexpr.c strexpr.c strexpr.h t1imager.h t1stub.c \
- t1test.c texfiles.c texfiles.h trig.h usenet
-DISTCLEANFILES = Symbol*
+TESTS_ENVIRONMENT = KPSEWHICH='$(KPSEWHICH)'
+TESTS = tests/lmmath.test tests/ps2pk.test
+EXTRA_DIST = $(TESTS) tests/lmmi12.600pk tests/Symbol.afm \
+ tests/Symbol.alpha.hex tests/Symbol.alpha.pix tests/Symbol.pfa \
+ tests/Symbol.pfb tests/Symbol10.300pk CHANGES.type1 \
+ INSTALLATION README.14m README.type1 basename.c flisearch.c \
+ pktest.c protos.h psearch.c sexpr.c strexpr.c strexpr.h \
+ t1imager.h t1stub.c t1test.c texfiles.c texfiles.h trig.h \
+ usenet
+DISTCLEANFILES = lmmi12.600pk Symbol*
all: c-auto.h
$(MAKE) $(AM_MAKEFLAGS) all-am
diff --git a/Build/source/texk/ps2pkm/configure b/Build/source/texk/ps2pkm/configure
index c2f52c0e69e..b2ac259d81f 100755
--- a/Build/source/texk/ps2pkm/configure
+++ b/Build/source/texk/ps2pkm/configure
@@ -640,6 +640,7 @@ KPATHSEA_RULE
KPATHSEA_DEPEND
KPATHSEA_LIBS
KPATHSEA_INCLUDES
+KPSEWHICH
CPP
OTOOL64
OTOOL
@@ -13182,6 +13183,50 @@ done
ac_config_headers="$ac_config_headers c-auto.h:c-auto.in"
+for ac_prog in kpsewhich
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_KPSEWHICH+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$KPSEWHICH"; then
+ ac_cv_prog_KPSEWHICH="$KPSEWHICH" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_KPSEWHICH="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+KPSEWHICH=$ac_cv_prog_KPSEWHICH
+if test -n "$KPSEWHICH"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $KPSEWHICH" >&5
+$as_echo "$KPSEWHICH" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$KPSEWHICH" && break
+done
+test -n "$KPSEWHICH" || KPSEWHICH="false"
+
+
kpse_save_CPPFLAGS=$CPPFLAGS
kpse_save_LIBS=$LIBS
diff --git a/Build/source/texk/ps2pkm/configure.ac b/Build/source/texk/ps2pkm/configure.ac
index c9c8f35ada5..1e06fea270c 100644
--- a/Build/source/texk/ps2pkm/configure.ac
+++ b/Build/source/texk/ps2pkm/configure.ac
@@ -32,6 +32,9 @@ AC_CHECK_FUNCS([memset])
AC_CONFIG_HEADERS([c-auto.h:c-auto.in])
+dnl For tests
+AC_CHECK_PROGS([KPSEWHICH], [kpsewhich], [false])
+
KPSE_KPATHSEA_FLAGS
AC_CONFIG_FILES([Makefile])
diff --git a/Build/source/texk/ps2pkm/fontfcn.c b/Build/source/texk/ps2pkm/fontfcn.c
index 85c3e654e17..dfaeb8ff57d 100644
--- a/Build/source/texk/ps2pkm/fontfcn.c
+++ b/Build/source/texk/ps2pkm/fontfcn.c
@@ -165,7 +165,7 @@ struct region *fontfcnB(struct XYspace *S, unsigned char *code, int *lenP, int *
S = (struct XYspace *)Permanent(Scale((struct xobject *)S, 1.0 , 1.0));
/* call the type 1 routine to rasterize the character */
charpath = (struct region *)Type1Char(FontP,S,theStringP,SubrsArrayP,NULL,
- FontP->BluesP , mode);
+ FontP->BluesP, mode);
Destroy(S);
/* if Type1Char reported an error, then return */
if ( *mode == FF_PARSE_ERROR) return(NULL);
diff --git a/Build/source/texk/ps2pkm/paths.c b/Build/source/texk/ps2pkm/paths.c
index 684ff29b47b..fc7cb511cb9 100644
--- a/Build/source/texk/ps2pkm/paths.c
+++ b/Build/source/texk/ps2pkm/paths.c
@@ -579,6 +579,7 @@ struct segment *t1_ClosePath(
register struct segment *p,*last,*start; /* used in looping through path */
register fractpel x,y; /* current position in path */
register fractpel firstx,firsty; /* start position of sub path */
+ register struct segment *lastnonhint; /* last non-hint segment in path */
IfTrace1((MustTraceCalls),"ClosePath(%p)\n", p0);
if (p0 != NULL && p0->type == TEXTTYPE)
@@ -598,6 +599,7 @@ struct segment *t1_ClosePath(
p0 = UniquePath(p0);
+ lastnonhint = NULL;
/*
We now begin a loop through the path,
incrementing current 'x' and 'y'. We are searching
@@ -621,13 +623,16 @@ At each break, we insert a close segment.
/*< adjust 'last' if possible for a 0,0 close >*/
#define CLOSEFUDGE 3 /* if we are this close, let's change last segment */
-
if (r->dest.x != 0 || r->dest.y != 0) {
if (r->dest.x <= CLOSEFUDGE && r->dest.x >= -CLOSEFUDGE
&& r->dest.y <= CLOSEFUDGE && r->dest.y >= -CLOSEFUDGE) {
IfTrace2((PathDebug),
"ClosePath forced closed by (%d,%d)\n",
r->dest.x, r->dest.y);
+ if (lastnonhint == NULL)
+ t1_abort("unexpected NULL pointer in ClosePath");
+ lastnonhint->dest.x += r->dest.x;
+ lastnonhint->dest.y += r->dest.y;
r->dest.x = r->dest.y = 0;
}
}
@@ -642,6 +647,8 @@ At each break, we insert a close segment.
firstx = x + p->dest.x;
firsty = y + p->dest.y;
}
+ else if (p->type != HINTTYPE)
+ lastnonhint = p;
}
return(p0);
}
@@ -1162,8 +1169,10 @@ Returns the bounding box by setting the user's variables.
void QueryBounds(
register struct segment *p0, /* object to check for bound */
struct XYspace *S, /* coordinate space of returned values */
- DOUBLE *xminP, DOUBLE *yminP, /* lower left hand corner (set by routine) */
- DOUBLE *xmaxP, DOUBLE *ymaxP) /* upper right hand corner (set by routine) */
+ DOUBLE *xminP, DOUBLE *yminP,
+ /* lower left hand corner (set by routine) */
+ DOUBLE *xmaxP, DOUBLE *ymaxP)
+ /* upper right hand corner (set by routine) */
{
register struct segment *path; /* loop variable for path segments */
register fractpel lastx,lasty; /* loop variables: previous endingpoint */
diff --git a/Build/source/texk/ps2pkm/spaces.c b/Build/source/texk/ps2pkm/spaces.c
index d7b78984ae7..a8845e3a22e 100644
--- a/Build/source/texk/ps2pkm/spaces.c
+++ b/Build/source/texk/ps2pkm/spaces.c
@@ -782,7 +782,7 @@ struct xobject *xiRotate(
DOUBLE M[2][2];
- IfTrace2((MustTraceCalls),"Rotate(%p, %f)\n", obj, &degrees);
+ IfTrace2((MustTraceCalls),"Rotate(%p, %f)\n", obj, degrees);
M[0][0] = M[1][1] = DegreeCos(degrees);
M[1][0] = - (M[0][1] = DegreeSin(degrees));
diff --git a/Build/source/texk/ps2pkm/tests/lmmath.test b/Build/source/texk/ps2pkm/tests/lmmath.test
new file mode 100755
index 00000000000..074abe3c4f0
--- /dev/null
+++ b/Build/source/texk/ps2pkm/tests/lmmath.test
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+# Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+test -d tests || mkdir -p tests
+
+TEXMFCNF=$srcdir/../kpathsea
+
+encpath=`$KPSEWHICH lm-mathit.enc` || exit 77
+ENCFONTS="`dirname $encpath`"
+
+t1path=`$KPSEWHICH lmmi12.pfb` || exit 77
+T1FONTS="`dirname $t1path`"
+
+afmpath=`$KPSEWHICH lmmi12.afm` || exit 77
+AFMFONTS="`dirname $afmpath`"
+
+export TEXMFCNF ENCFONTS T1FONTS AFMFONTS
+
+./ps2pk -elm-mathit.enc -X600 -Y600 -R600 -S0 -E1 -P12.0 lmmi12.pfb lmmi12.600pk || exit 1
+diff $srcdir/tests/lmmi12.600pk lmmi12.600pk || exit 1
+
diff --git a/Build/source/texk/ps2pkm/tests/lmmi12.600pk b/Build/source/texk/ps2pkm/tests/lmmi12.600pk
new file mode 100644
index 00000000000..5d2fa7d66df
--- /dev/null
+++ b/Build/source/texk/ps2pkm/tests/lmmi12.600pk
Binary files differ