bug-groff
[Top][All Lists]
Advanced

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

[bug #63366] groff.texi: clarify handling of special fonts


From: G. Branden Robinson
Subject: [bug #63366] groff.texi: clarify handling of special fonts
Date: Mon, 14 Nov 2022 22:24:16 -0500 (EST)

Follow-up Comment #2, bug #63366 (project groff):

Here's my silly patch to aid font debugging.


diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 96697e076..f2f8d9443 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -170,6 +170,7 @@ public:
   int get_zoom();
   friend symbol get_font_name(int, environment *);
   friend symbol get_style_name(int);
+  friend void print_fonts();
 };
 
 class tfont_spec {
@@ -6310,6 +6311,26 @@ void special_request()
   skip_line();
 }
 
+void print_fonts()
+{
+  if (font_table_size > 0) {
+    errprint("font table size: %1\n", font_table_size);
+    errprint("font table:\n");
+    for (int i = 0; i < font_table_size; i++) {
+      font_info *f = font_table[i];
+      if (0 /* nullptr */ != f)
+       errprint("%1: %2\n", i, f->internal_name.contents());
+    }
+  }
+  errprint("global special fonts:\n");
+  special_font_list *sflp = global_special_fonts;
+  while (0 /* nullptr */ != sflp) {
+    errprint("%1\n", sflp->n);
+    sflp = sflp->next;
+  }
+  fflush(stderr);
+}
+
 void font_zoom_request()
 {
   font_lookup_info finfo;
@@ -6634,6 +6655,7 @@ void init_node_requests()
   init_request("ftr", font_translate);
   init_request("kern", kern_request);
   init_request("lg", ligature);
+  init_request("pft", print_fonts);
   init_request("rfschar", remove_font_special_character);
   init_request("shc", set_soft_hyphen_char);
   init_request("special", special_request);



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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