bugGNU roff - Bugs: bug #64966, [troff]: make the underline font...

 
 

bug #64966: [troff]: make the underline font environment-specific

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Sat 02 Dec 2023 09:18:03 PM UTC
   
 
Category:  Core Severity:  1 - Wish
Item Group:  Feature change Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 02 Dec 2023 09:18:03 PM UTC, original submission:  

While a little-used feature, it doesn't seem to be necessary for the "underline font" to be global.

Also, its value is not introspectable.  Add a read-only register `.uf` for it.

This simple patch doesn't work because `get_underline_fontno` isn't in scope.


diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 5d844ed20..e12b9f34c 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -3539,6 +3539,7 @@ void init_env_requests()
   init_string_env_reg(".sty", get_style_name_string);
   init_string_env_reg(".tabs", get_tabs);
   init_int_env_reg(".u", get_fill);
+  init_int_env_reg(".uf", get_underline_fontno);
   init_vunits_env_reg(".v", get_vertical_spacing);
   init_hunits_env_reg(".w", get_prev_char_width);
   init_int_env_reg(".zoom", get_zoom);


Fixing this means moving some machinery from node.cpp to env.cpp.

We can see that this probably should have been the case all along.


src/roff/troff/env.cpp:    if (fontno == get_underline_fontno())
src/roff/troff/env.cpp:    if (prev_fontno == get_underline_fontno())
src/roff/troff/env.cpp:      curenv->fontno = curenv->pre_underline_fontno;
src/roff/troff/env.cpp:    curenv->pre_underline_fontno = curenv->fontno;
src/roff/troff/env.cpp:    curenv->fontno = get_underline_fontno();
src/roff/troff/env.cpp:      fontno = pre_underline_fontno;
src/roff/troff/env.cpp:    errprint("  font number before underlining: %1\n", pre_underline_fontno);
src/roff/troff/env.cpp:  init_int_env_reg(".uf", get_underline_fontno);
src/roff/troff/env.h:  int pre_underline_fontno;
src/roff/troff/node.cpp:static int underline_fontno = 2;
src/roff/troff/node.cpp:    underline_fontno = finfo.position;
src/roff/troff/node.cpp:int get_underline_fontno()
src/roff/troff/node.cpp:  return underline_fontno;
src/roff/troff/node.h:extern int get_underline_fontno();


G. Branden Robinson <gbranden>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code