groff-commit
[Top][All Lists]
Advanced

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

[groff] 02/15: [troff]: Trivially refactor (select_font).


From: G. Branden Robinson
Subject: [groff] 02/15: [troff]: Trivially refactor (select_font).
Date: Thu, 12 Oct 2023 21:55:06 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 9c36bd0348dac94800113322d359d5598ae1a748
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Oct 7 17:37:06 2023 -0500

    [troff]: Trivially refactor (select_font).
    
    * src/roff/troff/env.cpp (font_change): Trivially refactor, renaming
      this function...
    
      (select_font): ...to this.  Doing so aligns with other use of the term
      "select" in groff font documentation.  Further, when formatting for
      typesetters, fonts can be "changed" in a different sense by altering
      height, slant, (constancy of) spacing, and magnification.  Also mark
      function as "static"; it needs no visibility outside this translation
      unit.
---
 ChangeLog              | 11 +++++++++++
 src/roff/troff/env.cpp |  4 ++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 224236c0e..118462360 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2023-10-07  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/env.cpp (font_change): Trivially refactor,
+       renaming this function...
+       (select_font): ...to this.  Doing so aligns with other use of
+       the term "select" in groff font documentation.  Further, when
+       formatting for typesetters, fonts can be "changed" in a
+       different sense by altering height, slant, (constancy of)
+       spacing, and magnification.  Also mark function as "static"; it
+       needs no visibility outside this translation unit.
+
 2023-10-07  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [troff]: Throw error diagnostic on attempt to select a font
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index c0d47fcfa..6ee1ff80c 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -1231,7 +1231,7 @@ void glyph_color_change()
 
 static symbol P_symbol("P");
 
-void font_change()
+static void select_font()
 {
   symbol s = get_name();
   bool is_number = true;
@@ -3460,7 +3460,7 @@ void init_env_requests()
   init_request("fc", field_characters);
   init_request("fi", fill);
   init_request("fcolor", fill_color_change);
-  init_request("ft", font_change);
+  init_request("ft", select_font);
   init_request("gcolor", glyph_color_change);
   init_request("hc", hyphen_char);
   init_request("hlm", hyphen_line_max_request);



reply via email to

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