Request for bugfix - rule nodes (subtypes: 1 = box, 2 = image, 3 = empty, 4 = user) in DVI mode
Three things to be fixed for the rule nodes with subtypes 1 to 4 in DVi mode. (Function dvi_place_rule from dvigen.c file) void dvi_place_rule(PDF pdf, halfword q, scaledpos size) { synch_dvi_with_pos(pdf->posstruct->pos); if ((subtype(q) >= box_rule) && (subtype(q) <= user_rule)) { /*tex place nothing, only take space */ if (textdir_is_L(pdf->posstruct->dir)) dvi.h += size.h; } else { /*tex normal_rule or >= 100 being a leader rule */ if (textdir_is_L(pdf->posstruct->dir)) { /*tex movement optimization for |dir_*L*| */ dvi_out(set_rule); dvi.h += size.h; } else dvi_out(put_rule); } dvi_four(size.v); dvi_four(size.h); } Problem 1. Bad dvi file due the arguments output without dvi command (misplaced the two last lines in the code). Possible fix: void dvi_place_rule(PDF pdf, halfword q, scaledpos size) { synch_dvi_with_pos(pdf->posstruct->pos); if ((subtype(q) >= box_rule) && (subtype(q) <= user_rule)) { /*tex place nothing, only take space */ if (textdir_is_L(pdf->posstruct->dir)) dvi.h += size.h; } else { /*tex normal_rule or >= 100 being a leader rule */ if (textdir_is_L(pdf->posstruct->dir)) { /*tex movement optimization for |dir_*L*| */ dvi_out(set_rule); dvi.h += size.h; } else dvi_out(put_rule); dvi_four(size.v); dvi_four(size.h); } } Problem 2. Not reserved space for the rule in the output. Possible fix: void dvi_place_rule(PDF pdf, halfword q, scaledpos size) { synch_dvi_with_pos(pdf->posstruct->pos); if ((subtype(q) >= box_rule) && (subtype(q) <= user_rule)) { /*tex place nothing, only take space */ if (textdir_is_L(pdf->posstruct->dir)) dvi.h += size.h; movement(size.h, right1); } else { /*tex normal_rule or >= 100 being a leader rule */ if (textdir_is_L(pdf->posstruct->dir)) { /*tex movement optimization for |dir_*L*| */ dvi_out(set_rule); dvi.h += size.h; } else dvi_out(put_rule); dvi_four(size.v); dvi_four(size.h); } } Problem 3. Broken consistency with PDF mode as process_rule callback is missing in DVI mode. Possible fix: void dvi_place_rule(PDF pdf, halfword q, scaledpos size, int callback_id) { synch_dvi_with_pos(pdf->posstruct->pos); if ((subtype(q) >= box_rule) && (subtype(q) <= user_rule)) { /*tex place nothing, only take space */ if (textdir_is_L(pdf->posstruct->dir)) dvi.h += size.h; if (subtype(q) == user_rule && callback_id != 0) { run_callback(callback_id, “Ndd->”, q, size.h, size.v); } movement(size.h, right1); } else { /*tex normal_rule or >= 100 being a leader rule */ if (textdir_is_L(pdf->posstruct->dir)) { /*tex movement optimization for |dir_*L*| */ dvi_out(set_rule); dvi.h += size.h; } else dvi_out(put_rule); dvi_four(size.v); dvi_four(size.h); } } and fix in dvigen.h < extern void dvi_place_rule(PDF pdf, halfword q, scaledpos size);
extern void dvi_place_rule(PDF pdf, halfword q, scaledpos size, int callback_id);
Regards, Sigitas P.S. Some point for the discussion. For the wider usabillity maybe the rules with zero dimensions (width, height+depth) can be allowed in the output.
On 1/24/2020 10:48 AM, Sigitas Tolusis wrote:
Three things to be fixed for the rule nodes with subtypes 1 to 4 in DVi mode. (Function dvi_place_rule from dvigen.c file)
We'll have a look at it (not sure if that kind of patching will happen before tl 2020).
P.S. Some point for the discussion. For the wider usabillity maybe the rules with zero dimensions (width, height+depth) can be allowed in the output. We won't change tex's behaviour. You can use a 1sp width to cheat.
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Sigitas Tolusis