From fa847ea540224c1e343fb5f4d3b72e28e273e38a Mon Sep 17 00:00:00 2001 From: Brendan O'Dea Date: Mon, 24 Mar 2014 22:40:29 +1100 Subject: Add escapes to adjust spacing of italic text at roman/italic boundaries --- help2man.PL | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'help2man.PL') diff --git a/help2man.PL b/help2man.PL index 1b809b6..14d014f 100755 --- a/help2man.PL +++ b/help2man.PL @@ -157,6 +157,7 @@ sub N_ { $_[0] } sub program_basename; sub get_option_value; sub convert_option; +sub fix_italic_spacing; my $version_info = enc_user sprintf _(<<'EOT'), $this_program, $this_version; GNU %s %s @@ -491,6 +492,7 @@ if ($help_text =~ s/^($PAT_USAGE):( +(\S+))(.*)((?:\n(?: {6}\1| *($PAT_USAGE_CON s/\\fI$//; s/^\./\\&./; + $_ = fix_italic_spacing $_; $synopsis .= "$_\n"; } @@ -695,6 +697,8 @@ while (length) ) ($|[ ,;.)]) # space/punctuation after !$1\\fI$2\\fP$3!xmg; + + $_ = fix_italic_spacing $_; } # Escape remaining hyphens. @@ -860,6 +864,15 @@ sub convert_option $_; } + +# Insert spacing escape characters \, and \/ before and after italic text. See +# http://www.gnu.org/software/groff/manual/html_node/Ligatures-and-Kerning.html +sub fix_italic_spacing +{ + local $_ = shift; + s!\\fI(.*?)\\f([BRP])!\\fI\\,$1\\/\\f$2!g; + return $_; +} !NO!SUBS! # Rename output and fix permissions -- cgit v1.2.1