groff
[Top][All Lists]
Advanced

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

[Groff] Re: bug in groff -Thtml


From: Gaius Mulley
Subject: [Groff] Re: bug in groff -Thtml
Date: Wed, 07 Aug 2002 11:55:09 +0100

Hi,

Paul Sheer <address@hidden> writes:

> I also have another request. It should be easy to support
> the full font-set, "R I B BI CR CI CB CBI", for HTML, yet
> only "R I BI CR" are supported. Why is this? Is any support
> planned for the future?

here is a small patch which fixes the above.. an oversight..
on my part. If someone wants a little puzzle to solve over
coffee - they could combine html_printer::start_font and
html_printer::end_font (in src/devices/grohtml/post-html.cc)
to reduce the number of tags emitted.
Currently this is left as `an exercise for the reader' :-)

Gaius


--- groff-cvs/src/devices/grohtml/post-html.cc  Sun Jul 28 00:40:03 2002
+++ groff-html/src/devices/grohtml/post-html.cc Wed Aug  7 11:32:09 2002
@@ -2908,6 +2908,16 @@
     current_paragraph->done_italic();
   } else if (strcmp(fontname, "CR") == 0) {
     current_paragraph->done_tt();
+  } else if (strcmp(fontname, "CI") == 0) {
+    current_paragraph->done_italic();
+    current_paragraph->done_tt();
+  } else if (strcmp(fontname, "CB") == 0) {
+    current_paragraph->done_bold();
+    current_paragraph->done_tt();
+  } else if (strcmp(fontname, "CBI") == 0) {
+    current_paragraph->done_bold();
+    current_paragraph->done_italic();
+    current_paragraph->done_tt();
   }
 }
 
@@ -2933,6 +2943,25 @@
       current_paragraph->do_pre();
     }
     current_paragraph->do_tt();
+  } else if (strcmp(fontname, "CI") == 0) {
+    if ((! fill_on) && (is_courier_until_eol())) {
+      current_paragraph->do_pre();
+    }
+    current_paragraph->do_tt();
+    current_paragraph->do_italic();
+  } else if (strcmp(fontname, "CB") == 0) {
+    if ((! fill_on) && (is_courier_until_eol())) {
+      current_paragraph->do_pre();
+    }
+    current_paragraph->do_tt();
+    current_paragraph->do_bold();
+  } else if (strcmp(fontname, "CBI") == 0) {
+    if ((! fill_on) && (is_courier_until_eol())) {
+      current_paragraph->do_pre();
+    }
+    current_paragraph->do_tt();
+    current_paragraph->do_italic();
+    current_paragraph->do_bold();
   }
 }
 
--- groff-cvs/src/devices/grohtml/html-text.cc  Fri Jul 19 10:32:03 2002
+++ groff-html/src/devices/grohtml/html-text.cc Wed Aug  7 11:03:57 2002
@@ -374,11 +374,8 @@
 
 void html_text::do_italic (void)
 {
-  done_bold();
-  done_tt();
-  if (! is_present(I_TAG)) {
+  if (! is_present(I_TAG))
     push_para(I_TAG);
-  }
 }
 
 /*
@@ -387,11 +384,8 @@
 
 void html_text::do_bold (void)
 {
-  done_italic();
-  done_tt();
-  if (! is_present(B_TAG)) {
+  if (! is_present(B_TAG))
     push_para(B_TAG);
-  }
 }
 
 /*
@@ -400,11 +394,8 @@
 
 void html_text::do_tt (void)
 {
-  done_bold();
-  done_italic();
-  if ((! is_present(TT_TAG)) && (! is_present(PRE_TAG))) {
+  if ((! is_present(TT_TAG)) && (! is_present(PRE_TAG)))
     push_para(TT_TAG);
-  }
 }
 
 /*
@@ -413,8 +404,6 @@
 
 void html_text::do_pre (void)
 {
-  done_bold();
-  done_italic();
   done_tt();
   if (is_present(P_TAG)) {
     html_indent *i = remove_indent(P_TAG);
--- groff-cvs/font/devhtml/DESC.proto   Wed Jan 17 14:53:36 2001
+++ groff-html/font/devhtml/DESC.proto  Wed Aug  7 10:48:31 2002
@@ -3,7 +3,7 @@
 vert 40
 unitwidth 10
 sizes 6 8 10 12 14 16 18 0
-fonts 6 R I B BI C S
+fonts 9 R I B BI CR CI CB CBI S
 tcommand
 html
 postpro post-grohtml
--- groff-cvs/font/devhtml/Makefile.sub Wed Jan 17 14:54:42 2001
+++ groff-html/font/devhtml/Makefile.sub        Wed Aug  7 10:47:34 2002
@@ -1,5 +1,5 @@
 DEV=html
-PROTOFONTS=R I B BI CR
+PROTOFONTS=R I B BI CR CI CB CBI
 FONTS=$(PROTOFONTS) S
 DEVFILES=$(FONTS) DESC
 CLEANADD=$(FONTS) DESC

reply via email to

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