bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #66187] [troff] permit control over flushing of output file state


From: G. Branden Robinson
Subject: [bug #66187] [troff] permit control over flushing of output file state
Date: Sun, 8 Sep 2024 19:52:41 -0400 (EDT)

Follow-up Comment #1, bug #66187 (group groff):

Experimentation reveals that I can go *this* far with disabling the mandatory
state changes in these functions in "node.cpp" without triggering any
regressions.



diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 0a7b8bffe..4082a3eef 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -902,7 +902,6 @@ void troff_output_file::start_device_extension(tfont *tf,
color *gcol,
 void troff_output_file::start_device_extension()
 {
   flush_tbuf();
-  do_motion();
   put("x X ");
 }
 


And then...


diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 4082a3eef..e61a075bc 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -825,8 +825,7 @@ public:
   void right(hunits);
   void down(vunits);
   void moveto(hunits, vunits);
-  void start_device_extension(tfont * /* tf */,
-                             color * /* gcol */, color * /* fcol */,
+  void start_device_extension(color * /* fcol */,
                              bool /* omit_command_prefix */ = false);
   void start_device_extension();
   void write_device_extension_char(unsigned char c);
@@ -886,15 +885,18 @@ inline void troff_output_file::put(unsigned int i)
   put_string(ui_to_a(i), fp);
 }
 
-void troff_output_file::start_device_extension(tfont *tf, color *gcol,
-                                              color *fcol,
+void troff_output_file::start_device_extension(color *fcol,
                                               bool omit_command_prefix)
 {
+  flush_tbuf();
+#if 0
   set_font(tf);
   stroke_color(gcol);
+#endif
   fill_color(fcol);
-  flush_tbuf();
+#if 0
   do_motion();
+#endif
   if (!omit_command_prefix)
     put("x X ");
 }
@@ -3957,7 +3959,7 @@ node *device_extension_node::copy()
 
 void device_extension_node::tprint_start(troff_output_file *out)
 {
-  out->start_device_extension(tf, gcol, fcol, lacks_command_prefix);
+  out->start_device_extension(fcol, lacks_command_prefix);
 }
 
 void device_extension_node::tprint_char(troff_output_file *out,


Reading carefully, we see that only `fill_color()` is left active.  If I
disable that, too, the page background in "msboxes.pdf" turns black as Deri
and I discussed in bug #64484.

So, minimally, we just need `fl` to accept an argument that causes the fill
color command to be reƫmitted.

And then, I think, change the `pdfbackground` macro to use such an argumentful
`fl` request.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66187>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]