diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2014-03-28 15:33:53 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2014-03-28 15:33:53 +0000 |
commit | cf765726d33562cf94dbd3608efb46ba0cc1e3e4 (patch) | |
tree | fa3553a9e22a3ddc42d818feb1474f893067777b /Build/source/texk/web2c/luatexdir/pdf | |
parent | 137b56a5c65d26eec13dede7b8f398611aaa008d (diff) |
check in luatex 0.79.0 (release version)
git-svn-id: svn://tug.org/texlive/trunk@33312 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/pdf')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/pdf/pdfdest.w | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/pdf/pdffont.w | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/pdf/pdfgen.h | 3 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/pdf/pdfgen.w | 60 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/pdf/pdfpagetree.w | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/pdf/pdfthread.h | 4 |
6 files changed, 62 insertions, 21 deletions
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfdest.w b/Build/source/texk/web2c/luatexdir/pdf/pdfdest.w index 7b0c7261713..fbb103add26 100644 --- a/Build/source/texk/web2c/luatexdir/pdf/pdfdest.w +++ b/Build/source/texk/web2c/luatexdir/pdf/pdfdest.w @@ -19,8 +19,8 @@ @ @c static const char _svn_version[] = - "$Id: pdfdest.w 4448 2012-06-21 15:07:03Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/pdf/pdfdest.w $"; + "$Id: pdfdest.w 4956 2014-03-28 12:12:17Z luigi $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/pdf/pdfdest.w $"; #include "ptexlib.h" @@ -404,6 +404,7 @@ int output_name_tree(PDF pdf) delete_token_ref(pdf_names_toks); pdf_names_toks = null; } + print_pdf_table_string(pdf, "names"); pdf_end_dict(pdf); pdf_end_obj(pdf); return m; diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdffont.w b/Build/source/texk/web2c/luatexdir/pdf/pdffont.w index 967869b318c..20dba5e2fd5 100644 --- a/Build/source/texk/web2c/luatexdir/pdf/pdffont.w +++ b/Build/source/texk/web2c/luatexdir/pdf/pdffont.w @@ -21,7 +21,7 @@ @ @c static const char _svn_version[] = - "$Id: pdffont.w 4710 2014-01-02 13:26:55Z oneiros $" + "$Id: pdffont.w 4934 2014-03-26 08:17:27Z taco $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/pdf/pdffont.w $"; #include "ptexlib.h" @@ -51,6 +51,10 @@ scaled_whd output_one_char(PDF pdf, halfword p) int c = character(p); int ex_glyph = ex_glyph(p)/1000; ci = get_charinfo_whd(f, c); + if (!(char_exists(f,c))) { + char_warning(f,c); + return ci; + } //ci.wd = round_xn_over_d(ci.wd, 1000 + ex_glyph, 1000); ci.wd = ext_xn_over_d(ci.wd, 1000000 + ex_glyph(p), 1000000); switch (pdf->posstruct->dir) { diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h index 89fca3af9dd..9e2bee44f99 100644 --- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h +++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: pdfgen.h 4679 2013-12-19 15:47:53Z luigi $ */ +/* $Id: pdfgen.h 4956 2014-03-28 12:12:17Z luigi $ */ #ifndef PDFGEN_H # define PDFGEN_H @@ -197,6 +197,7 @@ extern char *get_resname_prefix(PDF); extern void pdf_begin_page(PDF pdf); extern void pdf_end_page(PDF pdf); extern void print_pdf_table_string(PDF pdf, const char *s); +extern char *get_pdf_table_string(const char *s); extern int get_pdf_table_bool(PDF, const char *, int); extern void fix_o_mode(PDF pdf); diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w index bfda9102e7b..7d6b74fd09c 100644 --- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w +++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w @@ -19,7 +19,7 @@ @ @c static const char _svn_version[] = - "$Id: pdfgen.w 4877 2014-03-14 01:26:05Z luigi $" + "$Id: pdfgen.w 4956 2014-03-28 12:12:17Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/pdf/pdfgen.w $"; #include "ptexlib.h" @@ -1884,9 +1884,10 @@ void print_pdf_table_string(PDF pdf, const char *s) { size_t len; const char *ls; - lua_getglobal(Luas, "pdf"); /* t ... */ + lua_rawgeti(Luas, LUA_REGISTRYINDEX, lua_key_index(pdf_data)); + lua_rawget(Luas, LUA_REGISTRYINDEX); lua_pushstring(Luas, s); /* s t ... */ - lua_gettable(Luas, -2); /* s? t ... */ + lua_rawget(Luas, -2); /* s? t ... */ if (lua_isstring(Luas, -1)) { /* s t ... */ ls = lua_tolstring(Luas, -1, &len); if (len > 0) { @@ -1900,6 +1901,23 @@ void print_pdf_table_string(PDF pdf, const char *s) } @ @c +char *get_pdf_table_string(const char *s) +{ + const_lstring ls; + lua_rawgeti(Luas, LUA_REGISTRYINDEX, lua_key_index(pdf_data)); + lua_rawget(Luas, LUA_REGISTRYINDEX); + lua_pushstring(Luas, s); /* s t ... */ + lua_rawget(Luas, -2); /* s? t ... */ + if (lua_isstring(Luas, -1)) { /* s t ... */ + ls.s = lua_tolstring(Luas, -1, &ls.l); + lua_pop(Luas, 2); /* ... */ + return (char *)ls.s; + } + lua_pop(Luas, 2); /* ... */ + return NULL ; +} + +@ @c #define pdf_page_attr equiv(pdf_page_attr_loc) #define pdf_page_resources equiv(pdf_page_resources_loc) @@ -2247,6 +2265,7 @@ static int pdf_print_info(PDF pdf, int luatexversion, boolean creator_given, producer_given, creationdate_given, moddate_given, trapped_given; char *s = NULL; + char *p = NULL; int k, len = 0; k = pdf_create_obj(pdf, obj_type_info, 0); pdf_begin_obj(pdf, k, 3); /* keep Info readable unless explicitely forced */ @@ -2264,16 +2283,13 @@ static int pdf_print_info(PDF pdf, int luatexversion, moddate_given = substr_of_str("/ModDate", s); trapped_given = substr_of_str("/Trapped", s); } - if (!producer_given) { - /* Print the Producer key */ - pdf_add_name(pdf, "Producer"); - pdf_puts(pdf, " (LuaTeX-"); - pdf_print_int(pdf, luatexversion / 100); - pdf_out(pdf, '.'); - pdf_print_int(pdf, luatexversion % 100); - pdf_out(pdf, '.'); - pdf_print(pdf, luatexrevision); - pdf_out(pdf, ')'); + p = get_pdf_table_string("info"); + if (strlen(p) > 0) { + creator_given = creator_given || substr_of_str("/Creator", p); + producer_given = producer_given || substr_of_str("/Producer", p); + creationdate_given = creationdate_given || substr_of_str("/CreationDate", p); + moddate_given = moddate_given || substr_of_str("/ModDate", p); + trapped_given = trapped_given || substr_of_str("/Trapped", p); } if (pdf_info_toks != null) { if (len > 0) { @@ -2285,6 +2301,22 @@ static int pdf_print_info(PDF pdf, int luatexversion, delete_token_ref(pdf_info_toks); pdf_info_toks = null; } + if (strlen(p) > 0) { + pdf_out(pdf, '\n'); + pdf_puts(pdf, p); /* no free, pointer */ + pdf_out(pdf, '\n'); + } + if (!producer_given) { + /* Print the Producer key */ + pdf_add_name(pdf, "Producer"); + pdf_puts(pdf, " (LuaTeX-"); + pdf_print_int(pdf, luatexversion / 100); + pdf_out(pdf, '.'); + pdf_print_int(pdf, luatexversion % 100); + pdf_out(pdf, '.'); + pdf_print(pdf, luatexrevision); + pdf_out(pdf, ')'); + } if (!creator_given) pdf_dict_add_string(pdf, "Creator", "TeX"); if (!creationdate_given) { @@ -2443,6 +2475,7 @@ void finish_pdf_file(PDF pdf, int luatexversion, str_number luatexrevision) delete_token_ref(pdf_catalog_toks); pdf_catalog_toks = null; } + print_pdf_table_string(pdf, "catalog"); if (pdf_catalog_openaction != 0) pdf_dict_add_ref(pdf, "OpenAction", pdf_catalog_openaction); pdf_end_dict(pdf); @@ -2490,6 +2523,7 @@ void finish_pdf_file(PDF pdf, int luatexversion, str_number luatexrevision) delete_token_ref(pdf_trailer_toks); pdf_trailer_toks = null; } + print_pdf_table_string(pdf, "trailer"); print_ID(pdf); pdf_dict_add_streaminfo(pdf); pdf_end_dict(pdf); diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfpagetree.w b/Build/source/texk/web2c/luatexdir/pdf/pdfpagetree.w index 8d5708d1027..d35d91578d9 100644 --- a/Build/source/texk/web2c/luatexdir/pdf/pdfpagetree.w +++ b/Build/source/texk/web2c/luatexdir/pdf/pdfpagetree.w @@ -19,8 +19,8 @@ @ @c static const char _svn_version[] = - "$Id: pdfpagetree.w 4634 2013-04-21 14:45:45Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/pdf/pdfpagetree.w $"; + "$Id: pdfpagetree.w 4957 2014-03-28 13:14:51Z taco $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/pdf/pdfpagetree.w $"; #include "ptexlib.h" @@ -226,6 +226,7 @@ static void write_pages(PDF pdf, pages_entry * p, int parent) pdf_out(pdf, ' '); } print_pdf_table_string(pdf, "pagesattributes"); + pdf_out(pdf, ' '); } else pdf_dict_add_ref(pdf, "Parent", parent); pdf_dict_add_int(pdf, "Count", (int) p->number_of_pages); diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfthread.h b/Build/source/texk/web2c/luatexdir/pdf/pdfthread.h index c1671f4f0aa..acc6f1aa66f 100644 --- a/Build/source/texk/web2c/luatexdir/pdf/pdfthread.h +++ b/Build/source/texk/web2c/luatexdir/pdf/pdfthread.h @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: pdfthread.h 3905 2010-10-02 20:29:20Z hhenkel $ */ +/* $Id: pdfthread.h 4935 2014-03-26 08:17:57Z taco $ */ #ifndef PDFTHREAD_H -# define PDFTHREADH +# define PDFTHREAD_H /* data structure of threads; words 1..4 represent the coordinates of the corners */ |