summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2022-08-16 20:41:58 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2022-08-16 20:41:58 +0000
commit92941d4a5767fb81eb688739aa9e2cc9b305ddba (patch)
tree6f27f9be736e080f642d0d590bda79a2faf8a224 /Build/source/texk/web2c
parent998f5e9837f6fa7c74e27348a19b8dedf9ee2ef1 (diff)
luatex: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@64127 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lpdflib.c16
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex_svnversion.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfgen.c13
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdftables.h3
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdftypes.h1
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/textoken.c1
-rw-r--r--Build/source/texk/web2c/luatexdir/utils/unistring.c50
8 files changed, 77 insertions, 13 deletions
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index dec1fc9bf54..06fa269e47d 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,7 @@
+2022-08-16 Luigi Scarso <luigi.scarso@gmail.com>
+ * Accent 0xFFFD but still error on invalid utf (compatible) (H.Hagen)
+ * omitinfodict added: \pdfvariable omitinfodict 1 omit Info dicttionary (H.Hagen)
+
2022-08-05 Luigi Scarso <luigi.scarso@gmail.com>
* Fixed a missed lua_settop in lua_appendtovlist_callback() (thanks to Hironori KITAGAWA)
diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
index 6396baa92cc..057af5ea6f3 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
@@ -814,6 +814,12 @@ static int getpdfomitcharset(lua_State * L)
return 1 ;
}
+static int getpdfomitinfodict(lua_State * L)
+{
+ lua_pushinteger(L, (pdf_omit_infodict));
+ return 1 ;
+}
+
static int setpdfgentounicode(lua_State * L)
{
if (lua_type(L, 1) == LUA_TNUMBER) {
@@ -838,6 +844,14 @@ static int setpdfomitcharset(lua_State * L)
return 0 ;
}
+static int setpdfomitinfodict(lua_State * L)
+{
+ if (lua_type(L, 1) == LUA_TNUMBER) {
+ set_pdf_omit_infodict(lua_tointeger(L, 1));
+ }
+ return 0 ;
+}
+
/* for tracing purposes when no pages are flushed */
static int setforcefile(lua_State * L)
@@ -1350,11 +1364,13 @@ static const struct luaL_Reg pdflib[] = {
{ "getgentounicode", getpdfgentounicode },
{ "getomitcidset", getpdfomitcidset },
{ "getomitcharset", getpdfomitcharset },
+ { "getomitinfo", getpdfomitinfodict },
{ "setinclusionerrorlevel", setpdfinclusionerrorlevel },
{ "setignoreunknownimages", setpdfignoreunknownimages },
{ "setgentounicode", setpdfgentounicode },
{ "setomitcidset", setpdfomitcidset },
{ "setomitcharset", setpdfomitcharset },
+ { "setomitinfo", setpdfomitinfodict },
{ "setforcefile", setforcefile },
{ "mapfile", l_mapfile },
{ "mapline", l_mapline },
diff --git a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
index 8103417f884..d513865325a 100644
--- a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
+++ b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
@@ -1,4 +1,4 @@
#ifndef luatex_svn_revision_h
#define luatex_svn_revision_h
-#define luatex_svn_revision 7536
+#define luatex_svn_revision 7538
#endif
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.c b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.c
index 9ed47cc9e73..bc9e1442046 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.c
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.c
@@ -2227,7 +2227,8 @@ void pdf_finish_file(PDF pdf, int fatal_error) {
print_err(" ==> Fatal error occurred, no output PDF file produced!");
} else {
int i, j, k;
- int root, info;
+ int root = 0;
+ int info = 0;
int xref_stm = 0;
int outlines = 0;
int threads = 0;
@@ -2268,6 +2269,7 @@ void pdf_finish_file(PDF pdf, int fatal_error) {
pdf->gen_tounicode = pdf_gen_tounicode;
pdf->omit_cidset = pdf_omit_cidset;
pdf->omit_charset = pdf_omit_charset;
+ pdf->omit_infodict = pdf_omit_infodict;
/*tex
The first pass over the list will flag the slots that are
used so that we can do a preroll for type 3 fonts.
@@ -2384,7 +2386,8 @@ void pdf_finish_file(PDF pdf, int fatal_error) {
print_pdf_table_string(pdf, "catalog");
pdf_end_dict(pdf);
pdf_end_obj(pdf);
- info = pdf_print_info(pdf, luatexversion, luatexrevision);
+ if (! pdf->omit_infodict)
+ info = pdf_print_info(pdf, luatexversion, luatexrevision);
if (pdf->os_enable) {
pdf_buffer_select(pdf, OBJSTM_BUF);
pdf_os_write_objstream(pdf);
@@ -2418,7 +2421,8 @@ void pdf_finish_file(PDF pdf, int fatal_error) {
pdf_add_int(pdf, 1);
pdf_end_array(pdf);
pdf_dict_add_ref(pdf, "Root", root);
- pdf_dict_add_ref(pdf, "Info", info);
+ if (! pdf->omit_infodict)
+ pdf_dict_add_ref(pdf, "Info", info);
if (pdf_trailer_toks != null) {
pdf_print_toks(pdf, pdf_trailer_toks);
delete_token_ref(pdf_trailer_toks);
@@ -2476,7 +2480,8 @@ void pdf_finish_file(PDF pdf, int fatal_error) {
pdf_begin_dict(pdf);
pdf_dict_add_int(pdf, "Size", pdf->obj_ptr + 1);
pdf_dict_add_ref(pdf, "Root", root);
- pdf_dict_add_ref(pdf, "Info", info);
+ if (! pdf->omit_infodict)
+ pdf_dict_add_ref(pdf, "Info", info);
if (pdf_trailer_toks != null) {
pdf_print_toks(pdf, pdf_trailer_toks);
delete_token_ref(pdf_trailer_toks);
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdftables.h b/Build/source/texk/web2c/luatexdir/pdf/pdftables.h
index 5eb9eb86d09..aa9aaef96cf 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdftables.h
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdftables.h
@@ -141,6 +141,7 @@ typedef enum {
c_pdf_omit_cidset,
c_pdf_recompress,
c_pdf_omit_charset,
+ c_pdf_omit_infodict,
} pdf_backend_counters ;
typedef enum {
@@ -190,6 +191,7 @@ extern int pdf_cur_form;
# define pdf_suppress_optional_info get_tex_extension_count_register(c_pdf_suppress_optional_info)
# define pdf_omit_cidset get_tex_extension_count_register(c_pdf_omit_cidset)
# define pdf_omit_charset get_tex_extension_count_register(c_pdf_omit_charset)
+# define pdf_omit_infodict get_tex_extension_count_register(c_pdf_omit_infodict)
# define pdf_recompress get_tex_extension_count_register(c_pdf_recompress)
# define pdf_h_origin get_tex_extension_dimen_register(d_pdf_h_origin)
@@ -213,6 +215,7 @@ extern int pdf_cur_form;
# define set_pdf_obj_compress_level(i) set_tex_extension_count_register(c_pdf_obj_compress_level,i)
# define set_pdf_omit_cidset(i) set_tex_extension_count_register(c_pdf_omit_cidset,i)
# define set_pdf_omit_charset(i) set_tex_extension_count_register(c_pdf_omit_charset,i)
+# define set_pdf_omit_infodict(i) set_tex_extension_count_register(c_pdf_omit_infodict,i)
# define set_pdf_gen_tounicode(i) set_tex_extension_count_register(c_pdf_gen_tounicode,i)
# define set_pdf_recompress(i) set_tex_extension_count_register(c_pdf_recompress,i)
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdftypes.h b/Build/source/texk/web2c/luatexdir/pdf/pdftypes.h
index 76bc69916b0..34b3322036a 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdftypes.h
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdftypes.h
@@ -295,6 +295,7 @@ typedef struct pdf_output_file_ {
int gen_tounicode;
int omit_cidset;
int omit_charset;
+ int omit_infodict;
int inclusion_copy_font;
int major_version; /* fixed major part of the PDF version */
int minor_version; /* fixed minor part of the PDF version */
diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.c b/Build/source/texk/web2c/luatexdir/tex/textoken.c
index ddf91b2b0c2..026f7d6bf15 100644
--- a/Build/source/texk/web2c/luatexdir/tex/textoken.c
+++ b/Build/source/texk/web2c/luatexdir/tex/textoken.c
@@ -2620,6 +2620,7 @@ static int do_variable_pdf(halfword c)
else if (scan_keyword("suppressoptionalinfo")) { do_variable_backend_int(c_pdf_suppress_optional_info); }
else if (scan_keyword("omitcidset")) { do_variable_backend_int(c_pdf_omit_cidset); }
else if (scan_keyword("omitcharset")) { do_variable_backend_int(c_pdf_omit_charset); }
+ else if (scan_keyword("omitinfodict")) { do_variable_backend_int(c_pdf_omit_infodict); }
else if (scan_keyword("recompress")) { do_variable_backend_int(c_pdf_recompress); }
else if (scan_keyword("horigin")) { do_variable_backend_dimen(d_pdf_h_origin); }
diff --git a/Build/source/texk/web2c/luatexdir/utils/unistring.c b/Build/source/texk/web2c/luatexdir/utils/unistring.c
index 6c95ee31e67..bad0fd77da2 100644
--- a/Build/source/texk/web2c/luatexdir/utils/unistring.c
+++ b/Build/source/texk/web2c/luatexdir/utils/unistring.c
@@ -32,6 +32,7 @@ static void utf_error(void)
deletions_allowed = true;
}
+/*
unsigned str2uni(const unsigned char *k)
{
register int ch;
@@ -40,7 +41,7 @@ unsigned str2uni(const unsigned char *k)
if ((ch = *text++) < 0x80) {
val = (unsigned) ch;
} else if (ch <= 0xbf) {
- /*tex An error that we skip. */
+ //
} else if (ch <= 0xdf) {
if (*text >= 0x80 && *text < 0xc0)
val = (unsigned) (((ch & 0x1f) << 6) | (*text++ & 0x3f));
@@ -58,18 +59,51 @@ unsigned str2uni(const unsigned char *k)
if (*text < 0x80 || text[1] < 0x80 || text[2] < 0x80 ||
*text >= 0xc0 || text[1] >= 0xc0 || text[2] >= 0xc0)
val = 0xFFFD;
- } else {
- /*tex
-
- The 5- and 6-byte UTF-8 sequences generate integers that are outside
- of the valid UCS range, and therefore unsupported.
-
- */
}
if (val == 0xFFFD)
utf_error();
return (val);
}
+*/
+
+/*
+ Per August 13 2022 we do the following. We still error on an invalid utf because we
+ have to remain compatible but accept 0xFFFD as valid now.
+*/
+
+unsigned str2uni(const unsigned char *k)
+{
+ int val = -1;
+ const unsigned char *text = k;
+ register int ch = *text++;
+ if (ch < 0x80) {
+ val = (unsigned) ch;
+ } else if (ch <= 0xbf) {
+ /*tex An error. */
+ } else if (ch <= 0xdf) {
+ if (*text >= 0x80 && *text < 0xc0) {
+ val = (unsigned) (((ch & 0x1f) << 6) | (*text++ & 0x3f));
+ }
+ } else if (ch <= 0xef) {
+ if (*text >= 0x80 && *text < 0xc0 && text[1] >= 0x80 && text[1] < 0xc0) {
+ val = (unsigned) (((ch & 0xf) << 12) | ((text[0] & 0x3f) << 6) | (text[1] & 0x3f));
+ }
+ } else if (ch <= 0xf7) {
+ int w = (((ch & 0x7) << 2) | ((text[0] & 0x30) >> 4)) - 1, w2;
+ w = (w << 6) | ((text[0] & 0xf) << 2) | ((text[1] & 0x30) >> 4);
+ w2 = ((text[1] & 0xf) << 6) | (text[2] & 0x3f);
+ val = (unsigned) (w * 0x400 + w2 + 0x10000);
+ if (*text < 0x80 || text[1] < 0x80 || text[2] < 0x80 || *text >= 0xc0 || text[1] >= 0xc0 || text[2] >= 0xc0) {
+ val = -1;
+ }
+ }
+ if (val < 0) {
+ utf_error();
+ return 0xFFFD;
+ } else {
+ return val;
+ }
+}
/*tex