diff options
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/pdf/pdfthread.w')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/pdf/pdfthread.w | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfthread.w b/Build/source/texk/web2c/luatexdir/pdf/pdfthread.w index 85f7007aa67..b11e48c5fc0 100644 --- a/Build/source/texk/web2c/luatexdir/pdf/pdfthread.w +++ b/Build/source/texk/web2c/luatexdir/pdf/pdfthread.w @@ -19,7 +19,6 @@ @ @c - #include "ptexlib.h" @ @c @@ -32,9 +31,8 @@ void append_bead(PDF pdf, halfword p) { int a, b, c, t; if (global_shipping_mode == SHIPPING_FORM) - normal_error("pdf backend", "threads cannot be inside an XForm"); - t = pdf_get_obj(pdf, obj_type_thread, pdf_thread_id(p), - pdf_thread_named_id(p)); + normal_error("pdf backend", "threads cannot be inside an xform"); + t = pdf_get_obj(pdf, obj_type_thread, pdf_thread_id(p), pdf_thread_named_id(p)); b = pdf_create_obj(pdf, obj_type_others, 0); obj_bead_ptr(pdf, b) = pdf_get_mem(pdf, pdfmem_bead_size); set_obj_bead_page(pdf, b, pdf->last_page); @@ -87,9 +85,8 @@ void do_thread(PDF pdf, halfword p, halfword parent_box, scaledpos cur) @ @c void append_thread(PDF pdf, halfword parent_box, scaledpos cur) { - halfword p; scaled_whd alt_rule; - p = new_node(whatsit_node, pdf_thread_data_node); + halfword p = new_node(whatsit_node, pdf_thread_data_node); width(p) = pdf->thread.wd; height(p) = pdf->thread.ht; depth(p) = pdf->thread.dp; @@ -119,18 +116,18 @@ void end_thread(PDF pdf, halfword p) normal_error("pdf backend", "'endthread' ended up in different nesting level than 'startthread'"); if (is_running(pdf->thread.dp) && (pdf->last_thread != null)) { switch (pdf->posstruct->dir) { - case dir_TLT: - case dir_TRT: - pdf_ann_bottom(pdf->last_thread) = pos.v - pdf_thread_margin; - break; - case dir_LTL: - pdf_ann_right(pdf->last_thread) = pos.h + pdf_thread_margin; - break; - case dir_RTT: - pdf_ann_left(pdf->last_thread) = pos.h - pdf_thread_margin; - break; - default: - assert(0); + case dir_TLT: + case dir_TRT: + pdf_ann_bottom(pdf->last_thread) = pos.v - pdf_thread_margin; + break; + case dir_LTL: + pdf_ann_right(pdf->last_thread) = pos.h + pdf_thread_margin; + break; + case dir_RTT: + pdf_ann_left(pdf->last_thread) = pos.h - pdf_thread_margin; + break; + default: + formatted_warning("pdf backend","forcing bad dir %i to TLT in end tread",pdf->posstruct->dir); } } if (pdf->last_thread_named_id) @@ -154,18 +151,12 @@ void thread_title(PDF pdf, int t) void pdf_fix_thread(PDF pdf, int t) { halfword a; - normal_warning("pdf backend", "thread destination", false, false); if (obj_info(pdf, t) < 0) { - tprint("name{"); - print(-obj_info(pdf, t)); - tprint("}"); + char *ss = makecstring(-obj_info(pdf, t)); + formatted_warning("pdf backend", "unknown thread destination name '%s'",ss); } else { - tprint("num"); - print_int(obj_info(pdf, t)); + formatted_warning("pdf backend", "unknown thread destination num '%d'",obj_info(pdf, t)); } - tprint(" has been referenced but does not exist, replaced by a fixed one"); - print_ln(); - print_ln(); a = pdf_create_obj(pdf, obj_type_others, 0); pdf_begin_obj(pdf, a, OBJSTM_ALWAYS); pdf_begin_dict(pdf); @@ -182,7 +173,6 @@ void pdf_fix_thread(PDF pdf, int t) pdf_end_array(pdf); pdf_end_dict(pdf); pdf_end_obj(pdf); - pdf_begin_obj(pdf, t, OBJSTM_ALWAYS); pdf_begin_dict(pdf); pdf_add_name(pdf, "I"); @@ -250,7 +240,7 @@ void scan_thread_id(void) set_pdf_thread_id(cur_list.tail_field, cur_val); set_pdf_thread_named_id(cur_list.tail_field, 0); } else if (scan_keyword("name")) { - scan_pdf_ext_toks(); + scan_toks(false, true); set_pdf_thread_id(cur_list.tail_field, def_ref); set_pdf_thread_named_id(cur_list.tail_field, 1); } else { @@ -276,9 +266,9 @@ void print_bead_rectangles(PDF pdf) l = pdf_create_obj(pdf, obj_type_others, 0); pdf_begin_obj(pdf, l, OBJSTM_ALWAYS); pdf_begin_array(pdf); - i = obj_bead_data(pdf, k->info); /* pointer to a whatsit or whatsit-like node */ + i = obj_bead_data(pdf, k->info); /* pointer to a whatsit or whatsit-like node */ pdf_add_rect_spec(pdf, i); - if (subtype(i) == pdf_thread_data_node) /* thanh says it mis be destroyed here */ + if (subtype(i) == pdf_thread_data_node) flush_node(i); pdf_end_array(pdf); pdf_end_obj(pdf); |