summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/pdf
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-04-04 15:54:37 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-04-04 15:54:37 +0000
commit6594e56570ac8f430ea4c0681812e2e8103881db (patch)
tree3912cb8c0fffe05096078d42905c7862a59d2443 /Build/source/texk/web2c/luatexdir/pdf
parent2bec95b8ba68b5b743535e19a4ca1c32231eaec3 (diff)
web2c/luatexdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@40233 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/pdf')
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfgen.w23
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdflistout.w40
2 files changed, 33 insertions, 30 deletions
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
index c5db4c71413..5f6756b1e7d 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
@@ -1427,17 +1427,25 @@ difficult, we start with a simpler implementation using just the first two items
@c
+
+/*
+ A user supplied trailerid had better be an array! So maybe we need to check
+ for [] and error otherwise.
+*/
+
static void print_ID(PDF pdf)
{
if ((pdf_suppress_optional_info & 512) == 0) {
- if (pdf_trailer_id != 0) {
- char *s = NULL;
- int len;
- s = tokenlist_to_cstring(pdf_trailer_id, true, &len);
- /* this had better be an array! sp maybe we need to check for [] and error otherwise */
- pdf_add_name(pdf, "ID");
- pdf_out_block(pdf,s,len);
+ const char *p = NULL;
+ pdf_add_name(pdf, "ID");
+ p = get_pdf_table_string("trailerid");
+ if (p && strlen(p) > 0) {
+ pdf_puts(pdf,p);
+ } else if (pdf_trailer_id != 0) {
+ /* user provided one */
+ pdf_print_toks(pdf, pdf_trailer_id);
} else {
+ /* system provided one */
time_t t;
size_t size;
char time_str[32];
@@ -1473,7 +1481,6 @@ static void print_ID(PDF pdf)
md5_finish(&state, digest);
/* write the IDs */
convertStringToHexString((char *) digest, id, 16);
- pdf_add_name(pdf, "ID");
pdf_begin_array(pdf);
pdf_printf(pdf, "<%s> <%s>", id, id);
pdf_end_array(pdf);
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdflistout.w b/Build/source/texk/web2c/luatexdir/pdf/pdflistout.w
index 65295c6145b..b6f3e6ff1a1 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdflistout.w
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdflistout.w
@@ -112,7 +112,7 @@ void init_backend_functionpointers(output_mode o_mode)
track of the needed width in |w|. When it finds the node that will end
this segment, it stores the accumulated with in the |dir_dvi_h| field
of that end node, so that when that node is found later in the
-processing, the correct glue correction can be applied.
+processing, the correct glue correction can be applied (obsolete).
@c
static scaled simple_advance_width(halfword p)
@@ -154,7 +154,6 @@ static halfword calculate_width_to_enddir(halfword p, real cur_glue, scaled cur_
int dir_nest = 1;
halfword q = p, enddir_ptr = p;
scaled w = 0;
- halfword g; /* this is normally a global variable, but that is just too hideous */
real glue_temp; /* glue value before rounding */
int g_sign = glue_sign(this_box);
int g_order = glue_order(this_box);
@@ -178,7 +177,7 @@ static halfword calculate_width_to_enddir(halfword p, real cur_glue, scaled cur_
break;
case math_node:
/* begin mathskip code */
- if (glue_ptr(q) == zero_glue) {
+ if (glue_is_zero(q)) {
w += surround(q);
break;
} else {
@@ -186,17 +185,16 @@ static halfword calculate_width_to_enddir(halfword p, real cur_glue, scaled cur_
}
/* end mathskip code */
case glue_node:
- g = glue_ptr(q);
- w += width(g) - cur_g;
+ w += width(q) - cur_g;
if (g_sign != normal) {
if (g_sign == stretching) {
- if (stretch_order(g) == g_order) {
- cur_glue = cur_glue + stretch(g);
+ if (stretch_order(q) == g_order) {
+ cur_glue = cur_glue + stretch(q);
vet_glue(float_cast(glue_set(this_box)) * cur_glue);
cur_g = float_round(glue_temp);
}
- } else if (shrink_order(g) == g_order) {
- cur_glue = cur_glue - shrink(g);
+ } else if (shrink_order(q) == g_order) {
+ cur_glue = cur_glue - shrink(q);
vet_glue(float_cast(glue_set(this_box)) * cur_glue);
cur_g = float_round(glue_temp);
}
@@ -442,17 +440,16 @@ cur.h += x_advance(p);
case glue_node:
{
/* move right or output leaders, we use real multiplication */
- halfword g = glue_ptr(p);
- rule.wd = width(g) - cur_g;
+ rule.wd = width(p) - cur_g;
if (g_sign != normal) {
if (g_sign == stretching) {
- if (stretch_order(g) == g_order) {
- cur_glue = cur_glue + stretch(g);
+ if (stretch_order(p) == g_order) {
+ cur_glue = cur_glue + stretch(p);
vet_glue(float_cast(glue_set(this_box)) * cur_glue);
cur_g = float_round(glue_temp);
}
- } else if (shrink_order(g) == g_order) {
- cur_glue = cur_glue - shrink(g);
+ } else if (shrink_order(p) == g_order) {
+ cur_glue = cur_glue - shrink(p);
vet_glue(float_cast(glue_set(this_box)) * cur_glue);
cur_g = float_round(glue_temp);
}
@@ -654,7 +651,7 @@ cur.h += x_advance(p);
synctexmath(p, this_box);
}
/* begin mathskip code */
- if (glue_ptr(p) == zero_glue) {
+ if (glue_is_zero(p)) {
cur.h += surround(p);
break;
} else {
@@ -880,17 +877,16 @@ void vlist_out(PDF pdf, halfword this_box, int rule_callback_id)
case glue_node:
{
/* move down or output leaders, we use real multiplication */
- halfword g = glue_ptr(p);
- rule.ht = width(g) - cur_g;
+ rule.ht = width(p) - cur_g;
if (g_sign != normal) {
if (g_sign == stretching) {
- if (stretch_order(g) == g_order) {
- cur_glue = cur_glue + stretch(g);
+ if (stretch_order(p) == g_order) {
+ cur_glue = cur_glue + stretch(p);
vet_glue(float_cast(glue_set(this_box)) * cur_glue);
cur_g = float_round(glue_temp);
}
- } else if (shrink_order(g) == g_order) {
- cur_glue = cur_glue - shrink(g);
+ } else if (shrink_order(p) == g_order) {
+ cur_glue = cur_glue - shrink(p);
vet_glue(float_cast(glue_set(this_box)) * cur_glue);
cur_g = float_round(glue_temp);
}