gbranden pushed a commit to branch master
in repository groff.
commit a365bcc9d1a6789fa6ec0c408e3a3c5d50a87b50
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Apr 13 07:57:55 2026 -0500
src/roff/troff/node.cpp: Trivially refactor.
* src/roff/troff/node.cpp: Rename `mount_font_no_translate()` to
`assign_font_and_file_name_to_mounting_position()` and update ordering
of parameters to match the function name.
(mount_font_at_position_request): Rename this...
(assign_font_and_file_name_to_mounting_position): ...to this, and
resequence arguments.
(mount_font, is_font_name, font_family::resolve): Update call sites.
---
ChangeLog | 12 ++++++++++++
src/roff/troff/node.cpp | 24 +++++++++++++++---------
2 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c5d3476f6..ca620425c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2026-04-13 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/node.cpp: Trivially refactor. Rename
+ `mount_font_no_translate()` to
+ `assign_font_and_file_name_to_mounting_position()` and update
+ ordering of parameters to match the function name.
+ (mount_font_at_position_request): Rename this...
+ (assign_font_and_file_name_to_mounting_position): ...to this,
+ and resequence arguments.
+ (mount_font, is_font_name, font_family::resolve): Update
+ call sites.
+
2026-04-12 G. Branden Robinson <[email protected]>
* src/preproc/preconv/preconv.cpp (conversion_latin1)
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index a6357a9b1..fd7222dda 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -6666,12 +6666,15 @@ dictionary font_dictionary(50);
// that we've previously tried to mount the font and failed.
font nonexistent_font = font("\0");
-// Mount font at position `n` with troff identifier `name` and
-// description file name `filename` (these are often identical). If
-// `check_only`, just look up `name` in the existing list of mounted
-// fonts.
-static bool mount_font_no_translate(int n, symbol name, symbol filename,
- bool check_only = false)
+// Assign troff font identifier `name`, with font description file
+// `filename`, to mounting position `n`. (The former two are often
+// identical.) Return Boolean reporting success of this "mounting".
+//
+// If `check_only`, look up font identifier `name` in the existing
+// list of mounted fonts, and return Boolean indicating its presence.
+// TODO: We could use a separate function for "checking only".
+static bool assign_font_and_file_name_to_mounting_position(
+ symbol name, symbol filename, int n, bool check_only = false)
{
assert(n >= 0);
font *fm = 0 /* nullptr */;
@@ -6735,7 +6738,9 @@ bool mount_font(int n, symbol name, symbol external_name)
external_name = name;
else
external_name = get_font_translation(external_name);
- return mount_font_no_translate(n, name, external_name);
+ return assign_font_and_file_name_to_mounting_position(name,
+ external_name,
+ n);
}
// True for abstract styles and resolved font names.
@@ -6743,7 +6748,8 @@ bool is_font_name(symbol fam, symbol name)
{
if (is_abstract_style(name))
name = concat(fam, name);
- return mount_font_no_translate(0, name, name, true /* check only */);
+ return assign_font_and_file_name_to_mounting_position(name,
+ name /* ignored */, 0 /* ignored */, true /* check_only */);
}
bool is_abstract_style(symbol s)
@@ -6905,7 +6911,7 @@ int font_family::resolve(int mounting_position)
break;
if (n >= font_table_size) {
n = next_available_font_position();
- if (!mount_font_no_translate(n, f, f))
+ if (!assign_font_and_file_name_to_mounting_position(f, f, n))
return FONT_NOT_MOUNTED;
}
return map[pos] = n;
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit