From 0dc3be2d0449f6ba032fd8e0387e6ff72440a83d Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 8 Aug 2013 20:07:25 +0000 Subject: Implement the roff(7) font-escape sequence \f(BI "bold+italic". This improves the formatting of about 40 base manuals and reduces groff-mandoc formatting differences in base by about 5%. --- usr.bin/mandoc/mandoc.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'usr.bin/mandoc/mandoc.c') diff --git a/usr.bin/mandoc/mandoc.c b/usr.bin/mandoc/mandoc.c index e4903aa7b18..829561afbe2 100644 --- a/usr.bin/mandoc/mandoc.c +++ b/usr.bin/mandoc/mandoc.c @@ -1,7 +1,7 @@ -/* $Id: mandoc.c,v 1.36 2013/06/20 22:29:38 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.37 2013/08/08 20:07:24 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2011, 2012 Ingo Schwarze + * Copyright (c) 2011, 2012, 2013 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -292,13 +292,19 @@ mandoc_escape(const char **end, const char **start, int *sz) switch (gly) { case (ESCAPE_FONT): - /* - * Pretend that the constant-width font modes are the - * same as the regular font modes. - */ - if (2 == *sz && 'C' == **start) { - (*start)++; - (*sz)--; + if (2 == *sz) { + if ('C' == **start) { + /* + * Treat constant-width font modes + * just like regular font modes. + */ + (*start)++; + (*sz)--; + } else { + if ('B' == (*start)[0] && 'I' == (*start)[1]) + gly = ESCAPE_FONTBI; + break; + } } else if (1 != *sz) break; -- cgit v1.2.3