Update of bug #68948 (group groff):

                 Summary: [troff] enhance `pftr` request to interpret
arguments as font identifiers => [PATCH] [troff] enhance `pftr` request to
interpret arguments as font identifiers

    _______________________________________________________

Follow-up Comment #1:


$ git diff
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 7334fe8bb..f238306f5 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -6865,12 +6865,34 @@ static void translate_font_request() // .ftr
 // `pnr` and `pm`.  Will need to reject nonnegative integers.
 static void print_font_translation_request() // .pftr
 {
+  if (has_arg()) {
+    symbol from;
+    do {
+      from = read_identifier();
+      if (from.is_null()) {
+       skip_rest_of_argument();
+       continue;
+      }
+      if (is_nonnegative_integer(from.contents())) {
+       error("font translation applies to a font identifier,"
+             " not a mounting position (%1)", from.contents());
+       continue;
+      }
+      symbol to = get_font_translation(from);
+      // If the name translates to itself, there is no translation; the
+      // `from` font might not even exist.
+      if (strcmp(from.contents(), to.contents()) != 0)
+       errprint("%1\t%2\n", from.contents(), to.contents());
+    } while (has_arg());
+  }
+  else {
   dictionary_iterator iter(font_translation_dictionary);
   symbol from, to;
   // We must use the nuclear `reinterpret_cast` operator because GNU
   // troff's dictionary types use a pre-STL approach to containers.
   while (iter.get(&from, reinterpret_cast<void **>(&to)))
     errprint("%1\t%2\n", from.contents(), to.contents());
+  }
   fflush(stderr);
   skip_line();
   return;




    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature

Reply via email to