groff
[Top][All Lists]
Advanced

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

[Groff] groff_font.man update


From: Gaius Mulley
Subject: [Groff] groff_font.man update
Date: Fri, 28 Jan 2000 23:50:24 +0000 (GMT)

Hi Werner,

Here are the manual page groff_font.man diffs and a couple
of grohtml bug fixes. I've also introduced a comment delimiter
in the font files, documented in groff_font.man. I've taken
the liberty of adding this comment structure to devps
which I believe are the only font files which use comments,
so far? I thought it better to have an explicit comment delimiter
as the character encoding (used in devhtml) is optional and thus
the current code had no way of knowing which words are comments
and which are char encoding etc.

Do these changes meet with approval?

cheers Gaius

ps. I've included a uuencoded tar.gz devps directory
    as the diffs would be twice as large..
    I'll post the uuencoded file directly to you <address@hidden>
    no need for multiple copies of this 100k file
----------------------------------------------------------
--- groff-cvs/ChangeLog Thu Jan 27 22:07:19 2000
+++ groff-html/ChangeLog        Fri Jan 28 23:27:15 2000
@@ -1,3 +1,10 @@
+2000-01-28  Gaius Mulley  <address@hidden>
+
+       * man/groff_font.man: brought up to date regarding tcommand
+         extensions
+       * libtroff/font.cc: observes -- as a comment in the font files
+       * added comment delimiter inside devps font files
+       
 2000-01-27  Gaius Mulley  <address@hidden>
 
        Completed the pass_filenames implementation in troff.
diff -aruN groff-cvs/libgroff/font.cc groff-html/libgroff/font.cc
--- groff-cvs/libgroff/font.cc  Fri Jan 21 22:59:50 2000
+++ groff-html/libgroff/font.cc Thu Jan 27 15:06:36 2000
@@ -672,10 +672,14 @@
          }
 
          p = strtok(0, WS);
-         if (p == NULL) {
+         if ((p == NULL) || (strcmp(p, "--") == 0)) {
            metric.special_device_coding = NULL;
          } else {
            char *name=(char *)malloc(strlen(p)+1);
+
+           if (name == NULL) {
+             fatal("malloc failed while reading character encoding");
+           }
            strcpy(name, p);
            metric.special_device_coding = name;
          }
--- groff-cvs/grohtml/html.cc   Thu Jan 27 22:04:05 2000
+++ groff-html/grohtml/html.cc  Thu Jan 27 12:03:11 2000
@@ -1584,8 +1584,8 @@
 {
   int  index;
 
-  if (f == 0) {
-    return( 0 );
+  if ((f == 0) || (name == 0) || (strcmp(name, "") == 0)) {
+    return( NULL );
   } else {
     index = f->name_to_index(name);
     if (index == 0) {
@@ -1640,18 +1640,20 @@
          i += 2;
        }
        escaped_char[e] = (char)0;
-       translation = get_html_translation(f, escaped_char);
-       if (translation) {
-         l = strlen(translation);
-         t = max(0, min(l, buflen-b));
-         strncpy(&buf[b], translation, t);
-         b += t;
-       } else {
-         int index=f->name_to_index(escaped_char);
+       if (e > 0) {
+         translation = get_html_translation(f, escaped_char);
+         if (translation) {
+           l = strlen(translation);
+           t = max(0, min(l, buflen-b));
+           strncpy(&buf[b], translation, t);
+           b += t;
+         } else {
+           int index=f->name_to_index(escaped_char);
          
-         if (index != 0) {
-           buf[b] = f->get_code(index);
-           b++;
+           if (index != 0) {
+             buf[b] = f->get_code(index);
+             b++;
+           }
          }
        }
       }
--- groff-cvs/man/groff_font.man        Fri May 21 05:50:46 1999
+++ groff-html/man/groff_font.man       Thu Jan 27 17:10:33 2000
@@ -130,6 +130,18 @@
 The default font family is
 .IR fam .
 .TP
+use_charnames_in_special
+.B use_charnames_in_special
+indicates that troff should encode named characters inside special
+commands.
+.TP
+pass_filenames
+.B pass_filenames
+requests that troff tells the driver the source file name
+being processed. This is achieved by another tcommand:
+.B F
+.IR filename .
+.TP
 .B charset
 This line and everything following in the file are ignored.
 It is allowed for the sake of backwards compatibility.
@@ -210,7 +222,9 @@
 by blanks or tabs. The format is
 .IP
 .I
-name metrics type code comment
+name metrics type code encoding
+.B --
+.I comment
 .LP
 .I name
 identifies the character:
@@ -279,7 +293,14 @@
 .B 0X
 it will be intepreted as hexadecimal.
 .LP
-Anything on the line after the code field will be ignored.
+The
+.I encoding
+field gives the ascii encoding of the character which the postprocessor uses
+to print the character. This field is optional and has been introduced
+so that the html device driver can encode its character set. For example
+the character \e[Po] is represented as &pound; in html 4.0.
+.LP
+Anything on the line after the encoding field will be ignored.
 .LP
 The
 .I metrics


reply via email to

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