summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/pdf
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-04-03 23:16:04 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-04-03 23:16:04 +0000
commit97d03159fd78ed23db6984ba6432436f0982456c (patch)
treee52d903a409b8107bab1bb545d8790cae1a68157 /Build/source/texk/web2c/luatexdir/pdf
parent3eb9ea53b1a3c87c7e718b2d3680006f9df04c9e (diff)
web2c/luatexdir: revert
git-svn-id: svn://tug.org/texlive/trunk@40228 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, 30 insertions, 33 deletions
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
index 5f6756b1e7d..c5db4c71413 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
@@ -1427,25 +1427,17 @@ 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) {
- 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);
+ 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);
} else {
- /* system provided one */
time_t t;
size_t size;
char time_str[32];
@@ -1481,6 +1473,7 @@ 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 b6f3e6ff1a1..65295c6145b 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 (obsolete).
+processing, the correct glue correction can be applied.
@c
static scaled simple_advance_width(halfword p)
@@ -154,6 +154,7 @@ 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);
@@ -177,7 +178,7 @@ static halfword calculate_width_to_enddir(halfword p, real cur_glue, scaled cur_
break;
case math_node:
/* begin mathskip code */
- if (glue_is_zero(q)) {
+ if (glue_ptr(q) == zero_glue) {
w += surround(q);
break;
} else {
@@ -185,16 +186,17 @@ static halfword calculate_width_to_enddir(halfword p, real cur_glue, scaled cur_
}
/* end mathskip code */
case glue_node:
- w += width(q) - cur_g;
+ g = glue_ptr(q);
+ w += width(g) - cur_g;
if (g_sign != normal) {
if (g_sign == stretching) {
- if (stretch_order(q) == g_order) {
- cur_glue = cur_glue + stretch(q);
+ if (stretch_order(g) == g_order) {
+ cur_glue = cur_glue + stretch(g);
vet_glue(float_cast(glue_set(this_box)) * cur_glue);
cur_g = float_round(glue_temp);
}
- } else if (shrink_order(q) == g_order) {
- cur_glue = cur_glue - shrink(q);
+ } else if (shrink_order(g) == g_order) {
+ cur_glue = cur_glue - shrink(g);
vet_glue(float_cast(glue_set(this_box)) * cur_glue);
cur_g = float_round(glue_temp);
}
@@ -440,16 +442,17 @@ cur.h += x_advance(p);
case glue_node:
{
/* move right or output leaders, we use real multiplication */
- rule.wd = width(p) - cur_g;
+ halfword g = glue_ptr(p);
+ rule.wd = width(g) - cur_g;
if (g_sign != normal) {
if (g_sign == stretching) {
- if (stretch_order(p) == g_order) {
- cur_glue = cur_glue + stretch(p);
+ if (stretch_order(g) == g_order) {
+ cur_glue = cur_glue + stretch(g);
vet_glue(float_cast(glue_set(this_box)) * cur_glue);
cur_g = float_round(glue_temp);
}
- } else if (shrink_order(p) == g_order) {
- cur_glue = cur_glue - shrink(p);
+ } else if (shrink_order(g) == g_order) {
+ cur_glue = cur_glue - shrink(g);
vet_glue(float_cast(glue_set(this_box)) * cur_glue);
cur_g = float_round(glue_temp);
}
@@ -651,7 +654,7 @@ cur.h += x_advance(p);
synctexmath(p, this_box);
}
/* begin mathskip code */
- if (glue_is_zero(p)) {
+ if (glue_ptr(p) == zero_glue) {
cur.h += surround(p);
break;
} else {
@@ -877,16 +880,17 @@ void vlist_out(PDF pdf, halfword this_box, int rule_callback_id)
case glue_node:
{
/* move down or output leaders, we use real multiplication */
- rule.ht = width(p) - cur_g;
+ halfword g = glue_ptr(p);
+ rule.ht = width(g) - cur_g;
if (g_sign != normal) {
if (g_sign == stretching) {
- if (stretch_order(p) == g_order) {
- cur_glue = cur_glue + stretch(p);
+ if (stretch_order(g) == g_order) {
+ cur_glue = cur_glue + stretch(g);
vet_glue(float_cast(glue_set(this_box)) * cur_glue);
cur_g = float_round(glue_temp);
}
- } else if (shrink_order(p) == g_order) {
- cur_glue = cur_glue - shrink(p);
+ } else if (shrink_order(g) == g_order) {
+ cur_glue = cur_glue - shrink(g);
vet_glue(float_cast(glue_set(this_box)) * cur_glue);
cur_g = float_round(glue_temp);
}