diff options
author | Han The Thanh <hanthethanh@gmail.com> | 2009-04-03 23:45:22 +0000 |
---|---|---|
committer | Han The Thanh <hanthethanh@gmail.com> | 2009-04-03 23:45:22 +0000 |
commit | 0a599c29bd094c790bb658635d852a9abc01e162 (patch) | |
tree | 2a085062c69db51a35920d99aea6254299e725db | |
parent | 613c4af339514c80fc713d3ac84386487e7c2a3c (diff) |
import recent changes from pdftex
git-svn-id: svn://tug.org/texlive/trunk@12619 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/pdftex.web | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/pdftoepdf.cc | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/subfont.c | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/ttf2afm.c | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/utils.c | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/writejbig2.h | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/writet1.c | 55 |
7 files changed, 61 insertions, 16 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/pdftex.web b/Build/source/texk/web2c/pdftexdir/pdftex.web index 68d3649e312..ff8a47b1176 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftex.web +++ b/Build/source/texk/web2c/pdftexdir/pdftex.web @@ -15959,19 +15959,19 @@ begin pdf_end_text; pdf_print_ln("q"); if h <= one_bp then begin - pdf_set_origin_temp(cur_h, cur_v - (h + 1)/2); + pdf_set_origin_temp(x, y - (h + 1)/2); pdf_print("[]0 d 0 J "); pdf_print_bp(h); pdf_print(" w 0 0 m "); pdf_print_bp(w); pdf_print_ln(" 0 l S"); end else if w <= one_bp then begin - pdf_set_origin_temp(cur_h + (w + 1)/2, cur_v); + pdf_set_origin_temp(x + (w + 1)/2, y); pdf_print("[]0 d 0 J "); pdf_print_bp(w); pdf_print(" w 0 0 m 0 "); pdf_print_bp(h); pdf_print_ln(" l S"); end else begin - pdf_set_origin_temp(cur_h, cur_v); + pdf_set_origin_temp(x, y); pdf_print("0 0 "); pdf_print_bp(w); pdf_out(" "); pdf_print_bp(h); pdf_print_ln(" re f"); @@ -34766,7 +34766,7 @@ pdf_annot_node: begin print_mark(pdf_annot_data(p)); end; pdf_start_link_node: begin - print_esc("pdflink"); + print_esc("pdfstartlink"); @<Display <rule spec> for whatsit node created by \pdfTeX@>; if pdf_link_attr(p) <> null then begin print(" attr"); @@ -35525,7 +35525,7 @@ nesting level. @ @<Types...@>= @!pdf_link_stack_record = record - nesting_level: small_number; + nesting_level: integer; link_node: pointer; {holds a copy of the corresponding |pdf_start_link_node|} ref_link_node: pointer; {points to original |pdf_start_link_node|, or a copy of |link_node| created by |append_link| in diff --git a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc index 2bf858d842d..10c67f8eb4a 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc +++ b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc @@ -18,13 +18,13 @@ with pdfTeX; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include <aconf.h> #include <stdlib.h> #include <math.h> #include <stddef.h> #include <stdio.h> #include <string.h> #include <ctype.h> -#include <aconf.h> #include <GString.h> #include <gmem.h> #include <gfile.h> diff --git a/Build/source/texk/web2c/pdftexdir/subfont.c b/Build/source/texk/web2c/pdftexdir/subfont.c index 25795e6517e..6bad2e6c738 100644 --- a/Build/source/texk/web2c/pdftexdir/subfont.c +++ b/Build/source/texk/web2c/pdftexdir/subfont.c @@ -127,7 +127,7 @@ static sfd_entry *read_sfd(char *sfd_name) return NULL; } tex_printf("{"); - tex_printf(cur_file_name); + tex_printf("%s", cur_file_name); sfd = new_sfd_entry(); sfd->name = xstrdup(sfd_name); while (!sfd_eof()) { diff --git a/Build/source/texk/web2c/pdftexdir/ttf2afm.c b/Build/source/texk/web2c/pdftexdir/ttf2afm.c index ef6563f186c..0bc6068bd95 100644 --- a/Build/source/texk/web2c/pdftexdir/ttf2afm.c +++ b/Build/source/texk/web2c/pdftexdir/ttf2afm.c @@ -728,7 +728,7 @@ void print_glyph_name(FILE * f, long glyph_index, int convention) u->code); } ttf_warn - ("glyph %li have multiple encodings (the first one being used): %s", + ("glyph %li has multiple encodings (the first one being used): %s", glyph_index, buf); } } diff --git a/Build/source/texk/web2c/pdftexdir/utils.c b/Build/source/texk/web2c/pdftexdir/utils.c index 44b3993fa74..4c4656a5360 100644 --- a/Build/source/texk/web2c/pdftexdir/utils.c +++ b/Build/source/texk/web2c/pdftexdir/utils.c @@ -23,7 +23,11 @@ Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # include <stdio.h> #endif #include <sys/types.h> +#ifdef WIN32 +#define EX_SOFTWARE EXIT_FAILURE +#else #include <sysexits.h> +#endif #include <regex.h> #include <kpathsea/c-proto.h> #include <kpathsea/c-stat.h> diff --git a/Build/source/texk/web2c/pdftexdir/writejbig2.h b/Build/source/texk/web2c/pdftexdir/writejbig2.h index bb32cc1a93d..ed9d19da676 100644 --- a/Build/source/texk/web2c/pdftexdir/writejbig2.h +++ b/Build/source/texk/web2c/pdftexdir/writejbig2.h @@ -23,10 +23,10 @@ is part of Adobe PDF-1.4, and requires Acroread 5.0 or later. $Id$ ***********************************************************************/ +#include "ptexlib.h" #include <stdlib.h> #include <stdio.h> #include <assert.h> -#include "ptexlib.h" #include "ptexmac.h" #include "image.h" diff --git a/Build/source/texk/web2c/pdftexdir/writet1.c b/Build/source/texk/web2c/pdftexdir/writet1.c index 38529247f2f..f188b3f0708 100644 --- a/Build/source/texk/web2c/pdftexdir/writet1.c +++ b/Build/source/texk/web2c/pdftexdir/writet1.c @@ -765,6 +765,8 @@ static void t1_scan_param(void) return; if (t1_prefix(lenIV)) { t1_lenIV = t1_scan_num(t1_line_array + strlen(lenIV), 0); + if (t1_lenIV < 0) + pdftex_fail("negative value of lenIV is not supported"); return; } t1_scan_keys(); @@ -1119,10 +1121,44 @@ static void cs_fail(const char *cs_name, int subr, const char *fmt, ...) pdftex_fail("CharString (/%s): %s", cs_name, buf); } +/* fix a return-less subr by appending CS_RETURN */ +static void append_cs_return(cs_entry *ptr) +{ + unsigned short cr; + int i, k; + byte *p, *q, *data, *new_data; + assert(ptr != NULL && ptr->valid && ptr->used); + + /* decrypt the cs data to t1_buf_array, append CS_RETURN */ + p = t1_buf_array; + data = ptr->data + 4; + cr = 4330; + for (i = 0; i < ptr->cslen; i++) + *p++ = cs_getchar(); + *p = CS_RETURN; + + /* encrypt the new cs data to new_data */ + new_data = xtalloc(ptr->len + 1, byte); + memcpy(new_data, ptr->data, 4); + p = new_data + 4; + q = t1_buf_array; + cr = 4330; + for (i = 0; i < ptr->cslen + 1; i++) + *p++ = cencrypt(*q++, &cr); + memcpy(p, ptr->data + 4 + ptr->cslen, ptr->len - ptr->cslen - 4); + + /* update *ptr */ + xfree(ptr->data); + ptr->data = new_data; + ptr->len++; + ptr->cslen++; +} + static void cs_mark(const char *cs_name, int subr) { byte *data; int i, b, cs_len; + int last_cmd = 0; integer a, a1, a2; unsigned short cr; static integer lastargOtherSubr3 = 3; /* the argument of last call to @@ -1207,6 +1243,7 @@ static void cs_mark(const char *cs_name, int subr) "more arguments on stack (%i) than required (%i)", (int) (stack_ptr - cc_stack), (int) cc->nargs); } + last_cmd = b; switch (cc - cc_tab) { case CS_CALLSUBR: a1 = cc_get(-1); @@ -1247,6 +1284,12 @@ static void cs_mark(const char *cs_name, int subr) } } } + if (cs_name == NULL && last_cmd != CS_RETURN) { + pdftex_warn("last command in subr `%i' is not a RETURN; " + "I will add it now but please consider fixing the font", + (int) subr); + append_cs_return(ptr); + } return; cs_error: /* an error occured during parsing */ cc_clear(); @@ -1491,14 +1534,12 @@ static void t1_flush_cs(boolean is_subr) if (is_subr) { cr = 4330; cs_len = 0; + /* at this point we have t1_lenIV >= 0; + * a negative value would be caught in t1_scan_param() */ return_cs = xtalloc(t1_lenIV + 1, byte); - if (t1_lenIV > 0) { - for (cs_len = 0, r = return_cs; cs_len < t1_lenIV; cs_len++, r++) - *r = cencrypt(0x00, &cr); - *r = cencrypt(CS_RETURN, &cr); - } else { - *return_cs = CS_RETURN; - } + for (cs_len = 0, r = return_cs; cs_len < t1_lenIV; cs_len++, r++) + *r = cencrypt(0x00, &cr); + *r = cencrypt(CS_RETURN, &cr); cs_len++; } |