diff options
Diffstat (limited to 'man2html')
-rw-r--r-- | man2html/man2html.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/man2html/man2html.c b/man2html/man2html.c index 8fad356..e2a9295 100644 --- a/man2html/man2html.c +++ b/man2html/man2html.c @@ -19,6 +19,7 @@ #include <string.h> #include <ctype.h> #include <sys/stat.h> +#include <assert.h> #include "defs.h" #include "../src/version.h" @@ -478,11 +479,16 @@ Bug 2: incorrect font: after the .IP things are roman again. #define FC2 "</B>" #define FO3 "<TT>" #define FC3 "</TT>" +#define FO4 "<TT><I>" +#define FC4 "</I></TT>" -char *switchfont[16] = { "" , FC0 FO1, FC0 FO2, FC0 FO3, - FC1 FO0, "" , FC1 FO2, FC1 FO3, - FC2 FO0, FC2 FO1, "" , FC2 FO3, - FC3 FO0, FC3 FO1, FC3 FO2, "" }; +#define NFONTS 5 + +char *switchfont[25] = { "" , FC0 FO1, FC0 FO2, FC0 FO3, FC0 FO4, + FC1 FO0, "" , FC1 FO2, FC1 FO3, FC1 FO4, + FC2 FO0, FC2 FO1, "" , FC2 FO3, FC2 FO4, + FC3 FO0, FC3 FO1, FC3 FO2, "" , FC3 FO4, + FC4 FO0, FC4 FO1, FC4 FO2, FC4 FO3, "" }; static char * change_to_font(int nr) @@ -493,6 +499,7 @@ change_to_font(int nr) case '1': case '2': case '3': case '4': nr = nr-'1'; break; case V('C','W'): case V('C','R'): nr=3; break; + case V('C','O'): case V('C','I'): nr=4; break; case 'L': nr=3; break; case 'B': nr=2; break; case 'I': nr=1; break; @@ -501,8 +508,11 @@ change_to_font(int nr) case 'P': case 'R': default: nr=0; break; } - i= current_font*4+nr%4; - current_font=nr%4; + + assert (nr >= 0 && nr < NFONTS); + + i= current_font*NFONTS+nr; + current_font=nr; return switchfont[i]; } |