From 7e423bda977e3c3ce30a5225eda4cf775754d7ea Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 20 Sep 2014 11:33:47 -0700 Subject: Add a fifth font: courier italic. This font is used for CO and CI. It is useful for documenting meta-identifiers in code. --- man2html/man2html.c | 22 ++++++++++++++++------ 1 file 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 #include #include +#include #include "defs.h" #include "../src/version.h" @@ -478,11 +479,16 @@ Bug 2: incorrect font: after the .IP things are roman again. #define FC2 "" #define FO3 "" #define FC3 "" +#define FO4 "" +#define FC4 "" -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]; } -- cgit v1.2.3