* mandoc: Yet another round of improvements to manual font selection.
@ 2018-12-16 0:17 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2018-12-16 0:17 UTC (permalink / raw)
To: source
Log Message:
-----------
Yet another round of improvements to manual font selection.
Unify handling of \f and .ft.
Support \f4 (bold+italic).
Support ".ft BI" and ".ft CW" for terminal output.
Support the .ft request in HTML output.
Reject the bogus fonts \f(C1, \f(C2, \f(C3, and \f(CP.
In regress.pl, only strip leading whitespace in math mode.
Modified Files:
--------------
mandoc:
Makefile.depend
html.c
html.h
man_html.c
mandoc.c
mandoc.h
mandoc_headers.3
mdoc_html.c
roff.7
roff_html.c
roff_term.c
roff_validate.c
tbl_html.c
mandoc/regress:
regress.pl
mandoc/regress/roff/esc:
Makefile
f.in
f.out_ascii
mandoc/regress/roff/ft:
Makefile
badargs.in
badargs.out_ascii
badargs.out_lint
Added Files:
-----------
mandoc/regress/roff/esc:
f.out_html
mandoc/regress/roff/ft:
badargs.out_html
Revision Data
-------------
Index: regress.pl
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/regress.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -Lregress/regress.pl -Lregress/regress.pl -u -p -r1.8 -r1.9
--- regress/regress.pl
+++ regress/regress.pl
@@ -79,23 +79,25 @@ sub syshtml ($@) {
open my $outfd, '>', $outfile or die "$outfile: $!";
my $infd;
my $pid = open3 undef, $infd, undef, @_;
- my $state;
+ my $state = 0;
while (<$infd>) {
chomp;
if (!$state && s/.*<math class="eqn">//) {
- $state = 1;
+ $state = 'math';
next unless length;
+ } elsif (/^BEGINTEST/) {
+ $state = 'other';
}
- $state = 1 if /^BEGINTEST/;
- if ($state && s/<\/math>.*//) {
+ if ($state eq 'math') {
s/^ *//;
- print $outfd "$_\n" if length;
- undef $state;
- next;
+ if (s/<\/math>.*//) {
+ print $outfd "$_\n" if length;
+ $state = 0;
+ next;
+ }
}
- s/^ *//;
print $outfd "$_\n" if $state;
- undef $state if /^ENDTEST/;
+ $state = 0 if /^ENDTEST/;
}
close $outfd;
close $infd;
Index: mandoc_headers.3
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mandoc_headers.3,v
retrieving revision 1.28
retrieving revision 1.29
diff -Lmandoc_headers.3 -Lmandoc_headers.3 -u -p -r1.28 -r1.29
--- mandoc_headers.3
+++ mandoc_headers.3
@@ -556,7 +556,10 @@ or
Requires
.In sys/types.h
for
-.Vt size_t
+.Vt size_t ,
+.Pa mandoc.h
+for
+.Vt enum mandoc_esc ,
and
.Qq Pa out.h
for
Index: roff_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff_html.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -Lroff_html.c -Lroff_html.c -u -p -r1.14 -r1.15
--- roff_html.c
+++ roff_html.c
@@ -18,8 +18,10 @@
#include <sys/types.h>
#include <assert.h>
-#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include "mandoc.h"
#include "roff.h"
#include "out.h"
#include "html.h"
@@ -30,12 +32,13 @@ typedef void (*roff_html_pre_fp)(ROFF_HT
static void roff_html_pre_br(ROFF_HTML_ARGS);
static void roff_html_pre_ce(ROFF_HTML_ARGS);
+static void roff_html_pre_ft(ROFF_HTML_ARGS);
static void roff_html_pre_sp(ROFF_HTML_ARGS);
static const roff_html_pre_fp roff_html_pre_acts[ROFF_MAX] = {
roff_html_pre_br, /* br */
roff_html_pre_ce, /* ce */
- NULL, /* ft */
+ roff_html_pre_ft, /* ft */
NULL, /* ll */
NULL, /* mc */
NULL, /* po */
@@ -72,6 +75,15 @@ roff_html_pre_ce(ROFF_HTML_ARGS)
roff_html_pre(h, n);
}
roff_html_pre_br(h, n);
+}
+
+static void
+roff_html_pre_ft(ROFF_HTML_ARGS)
+{
+ const char *cp;
+
+ cp = n->child->string;
+ print_metaf(h, mandoc_font(cp, (int)strlen(cp)));
}
static void
Index: html.h
===================================================================
RCS file: /home/cvs/mandoc/mandoc/html.h,v
retrieving revision 1.95
retrieving revision 1.96
diff -Lhtml.h -Lhtml.h -u -p -r1.95 -r1.96
--- html.h
+++ html.h
@@ -125,6 +125,7 @@ void roff_html_pre(struct html *, con
void print_gen_comment(struct html *, struct roff_node *);
void print_gen_decls(struct html *);
void print_gen_head(struct html *);
+void print_metaf(struct html *, enum mandoc_esc);
struct tag *print_otag(struct html *, enum htmltag, const char *, ...);
void print_tagq(struct html *, const struct tag *);
void print_stagq(struct html *, const struct tag *);
Index: mdoc_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mdoc_html.c,v
retrieving revision 1.317
retrieving revision 1.318
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.317 -r1.318
--- mdoc_html.c
+++ mdoc_html.c
@@ -27,6 +27,7 @@
#include <unistd.h>
#include "mandoc_aux.h"
+#include "mandoc.h"
#include "roff.h"
#include "mdoc.h"
#include "out.h"
Index: roff.7
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff.7,v
retrieving revision 1.108
retrieving revision 1.109
diff -Lroff.7 -Lroff.7 -u -p -r1.108 -r1.109
--- roff.7
+++ roff.7
@@ -132,20 +132,73 @@ One-letter backslash escape.
See
.Xr mandoc_char 7
for a complete list.
-.Ss Text Decoration
-Terms may be text-decorated using the
-.Sq \ef
-escape followed by an indicator: B (bold), I (italic), R (regular), or P
-(revert to previous mode).
-A numerical representation 3, 2, or 1 (bold, italic, and regular,
-respectively) may be used instead.
-The indicator or numerical representative may be preceded by C
-(constant-width), which is ignored.
-.Pp
-The two-character indicator
-.Sq BI
-requests a font that is both bold and italic.
-It may not be portable to old roff implementations.
+.Ss Font Selection
+In
+.Xr mdoc 7
+and
+.Xr man 7
+documents, fonts are usually selected with macros.
+The
+.Ic \ef
+escape sequence and the
+.Ic \&ft
+request can be used to manually change the font,
+but this is not recommended in
+.Xr mdoc 7
+documents.
+Such manual font changes are overridden by many subsequent macros.
+.Pp
+The following fonts are supported:
+.Pp
+.Bl -tag -width CW -offset indent -compact
+.It Cm B
+Bold font.
+.It Cm BI
+A font that is both bold and italic.
+.It Cm CB
+Bold constant width font.
+Same as
+.Cm B
+in terminal output.
+.It Cm CI
+Italic constant width font.
+Same as
+.Cm I
+in terminal output.
+.It Cm CR
+Regular constant width font.
+Same as
+.Cm R
+in terminal output.
+.It Cm CW
+An alias for
+.Cm CR .
+.It Cm I
+Italic font.
+.It Cm P
+Return to the previous font.
+If a macro caused a font change since the last
+.Ic \ef
+eascape sequence or
+.Ic \&ft
+request, this returns to the font before the last font change in
+the macro rather than to the font before the last manual font change.
+.It Cm R
+Roman font.
+This is the default font.
+.It Cm 1
+An alias for
+.Cm R .
+.It Cm 2
+An alias for
+.Cm I .
+.It Cm 3
+An alias for
+.Cm B .
+.It Cm 4
+An alias for
+.Cm BI .
+.El
.Pp
Examples:
.Bl -tag -width Ds -offset indent -compact
@@ -156,12 +209,6 @@ Write in \fIitalic\fP, then return to pr
.It Li \ef(BIbold italic\efP
Write in \f(BIbold italic\fP, then return to previous font mode.
.El
-.Pp
-Text decoration is
-.Em not
-recommended for
-.Xr mdoc 7 ,
-which encourages semantic annotation.
.Ss Whitespace
Whitespace consists of the space character.
In text lines, whitespace is preserved within a line.
@@ -890,27 +937,12 @@ This is a Heirloom extension and current
Conditionally define a special font.
This is a groff extension and currently ignored.
.It Ic \&ft Op Ar font
-Change the font.
-The following
+Change the font; see
+.Sx Font Selection .
+The
.Ar font
-arguments are supported:
-.Bl -tag -width 4n -offset indent
-.It Cm B , BI , CB , 3 , 4
-switches to
-.Sy bold
-font
-.It Cm I , CI , 2
-switches to
-.Em underlined
-font
-.It Cm R , CR , CW , 1
-switches to normal font
-.It Cm P No "or no argument"
-switches back to the previous font
-.El
-.Pp
-This request takes effect only locally and may be overridden
-by macros and escape sequences.
+argument defaults to
+.Cm P .
.It Ic \&ftr Ar newname Op Ar oldname
Translate font name.
This is a groff extension and currently ignored.
@@ -2006,11 +2038,15 @@ and
Switch to the font
.Ar name ,
see
-.Sx Text Decoration .
+.Sx Font Selection .
For short names, there are variants
.Ic \ef Ns Ar c
and
.Ic \ef( Ns Ar cc .
+An empty name
+.Ic \ef[]
+defaults to
+.Ic \efP .
.It Ic \eg[ Ns Ar name Ns Ic \&]
Interpolate the format of a number register; ignored by
.Xr mandoc 1 .
Index: roff_validate.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff_validate.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -Lroff_validate.c -Lroff_validate.c -u -p -r1.14 -r1.15
--- roff_validate.c
+++ roff_validate.c
@@ -104,30 +104,8 @@ roff_valid_ft(ROFF_VALID_ARGS)
}
cp = n->child->string;
- switch (*cp) {
- case '1':
- case '2':
- case '3':
- case '4':
- case 'I':
- case 'P':
- case 'R':
- if (cp[1] == '\0')
- return;
- break;
- case 'B':
- if (cp[1] == '\0' || (cp[1] == 'I' && cp[2] == '\0'))
- return;
- break;
- case 'C':
- if (cp[1] != '\0' && cp[2] == '\0' &&
- strchr("BIRW", cp[1]) != NULL)
- return;
- break;
- default:
- break;
- }
-
+ if (mandoc_font(cp, (int)strlen(cp)) != ESCAPE_ERROR)
+ return;
mandoc_msg(MANDOCERR_FT_BAD, n->line, n->pos, "ft %s", cp);
roff_node_delete(man, n);
}
Index: roff_term.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff_term.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -Lroff_term.c -Lroff_term.c -u -p -r1.16 -r1.17
--- roff_term.c
+++ roff_term.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include <stdio.h>
+#include <string.h>
#include "mandoc.h"
#include "roff.h"
@@ -113,25 +114,22 @@ roff_term_pre_ft(ROFF_TERM_ARGS)
{
const char *cp;
- if (*(cp = n->child->string) == 'C')
- cp++;
-
- switch (*cp) {
- case '4':
- case '3':
- case 'B':
+ cp = n->child->string;
+ switch (mandoc_font(cp, (int)strlen(cp))) {
+ case ESCAPE_FONTBOLD:
term_fontrepl(p, TERMFONT_BOLD);
break;
- case '2':
- case 'I':
+ case ESCAPE_FONTITALIC:
term_fontrepl(p, TERMFONT_UNDER);
break;
- case 'P':
+ case ESCAPE_FONTBI:
+ term_fontrepl(p, TERMFONT_BI);
+ break;
+ case ESCAPE_FONTPREV:
term_fontlast(p);
break;
- case '1':
- case 'C':
- case 'R':
+ case ESCAPE_FONTROMAN:
+ case ESCAPE_FONTCW:
term_fontrepl(p, TERMFONT_NONE);
break;
default:
Index: man_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/man_html.c,v
retrieving revision 1.159
retrieving revision 1.160
diff -Lman_html.c -Lman_html.c -u -p -r1.159 -r1.160
--- man_html.c
+++ man_html.c
@@ -26,6 +26,7 @@
#include <string.h>
#include "mandoc_aux.h"
+#include "mandoc.h"
#include "roff.h"
#include "man.h"
#include "out.h"
Index: mandoc.h
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mandoc.h,v
retrieving revision 1.261
retrieving revision 1.262
diff -Lmandoc.h -Lmandoc.h -u -p -r1.261 -r1.262
--- mandoc.h
+++ mandoc.h
@@ -270,6 +270,7 @@ enum mandoc_esc {
};
+enum mandoc_esc mandoc_font(const char *, int sz);
enum mandoc_esc mandoc_escape(const char **, const char **, int *);
void mandoc_msg_setoutfile(FILE *);
const char *mandoc_msg_getinfilename(void);
Index: tbl_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/tbl_html.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -Ltbl_html.c -Ltbl_html.c -u -p -r1.30 -r1.31
--- tbl_html.c
+++ tbl_html.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <string.h>
+#include "mandoc.h"
#include "tbl.h"
#include "out.h"
#include "html.h"
Index: Makefile.depend
===================================================================
RCS file: /home/cvs/mandoc/mandoc/Makefile.depend,v
retrieving revision 1.39
retrieving revision 1.40
diff -LMakefile.depend -LMakefile.depend -u -p -r1.39 -r1.40
--- Makefile.depend
+++ Makefile.depend
@@ -34,7 +34,7 @@ html.o: html.c config.h mandoc_aux.h man
lib.o: lib.c config.h roff.h libmdoc.h lib.in
main.o: main.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h man.h mandoc_parse.h tag.h main.h manconf.h mansearch.h
man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h
-man_html.o: man_html.c config.h mandoc_aux.h roff.h man.h out.h html.h main.h
+man_html.o: man_html.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h html.h main.h
man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h
man_term.o: man_term.c config.h mandoc_aux.h roff.h man.h out.h term.h main.h
man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h
@@ -49,7 +49,7 @@ manpath.o: manpath.c config.h mandoc_aux
mansearch.o: mansearch.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h
mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
-mdoc_html.o: mdoc_html.c config.h mandoc_aux.h roff.h mdoc.h out.h html.h main.h
+mdoc_html.o: mdoc_html.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h html.h main.h
mdoc_macro.o: mdoc_macro.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h
mdoc_man.o: mdoc_man.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h out.h main.h
mdoc_markdown.o: mdoc_markdown.c mandoc_aux.h mandoc.h roff.h mdoc.h main.h
@@ -61,7 +61,7 @@ out.o: out.c config.h mandoc_aux.h tbl.h
preconv.o: preconv.c config.h mandoc.h roff.h mandoc_parse.h libmandoc.h
read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h libmandoc.h roff_int.h
roff.o: roff.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mandoc_parse.h libmandoc.h roff_int.h tbl_parse.h eqn_parse.h predefs.in
-roff_html.o: roff_html.c roff.h out.h html.h
+roff_html.o: roff_html.c mandoc.h roff.h out.h html.h
roff_term.o: roff_term.c mandoc.h roff.h out.h term.h
roff_validate.o: roff_validate.c mandoc.h roff.h libmandoc.h roff_int.h
soelim.o: soelim.c config.h compat_stringlist.h
@@ -69,7 +69,7 @@ st.o: st.c config.h mandoc.h roff.h libm
tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h tag.h
tbl.o: tbl.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_parse.h tbl_int.h
tbl_data.o: tbl_data.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_int.h
-tbl_html.o: tbl_html.c config.h tbl.h out.h html.h
+tbl_html.o: tbl_html.c config.h mandoc.h tbl.h out.h html.h
tbl_layout.o: tbl_layout.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_int.h
tbl_opts.o: tbl_opts.c config.h mandoc.h tbl.h libmandoc.h tbl_int.h
tbl_term.o: tbl_term.c config.h mandoc.h tbl.h out.h term.h
Index: html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/html.c,v
retrieving revision 1.246
retrieving revision 1.247
diff -Lhtml.c -Lhtml.c -u -p -r1.246 -r1.247
--- html.c
+++ html.c
@@ -117,7 +117,6 @@ static void print_ctag(struct html *, s
static int print_escape(struct html *, char);
static int print_encode(struct html *, const char *, const char *, int);
static void print_href(struct html *, const char *, const char *, int);
-static void print_metaf(struct html *, enum mandoc_esc);
void *
@@ -210,7 +209,7 @@ print_gen_head(struct html *h)
print_tagq(h, t);
}
-static void
+void
print_metaf(struct html *h, enum mandoc_esc deco)
{
enum htmlfont font;
@@ -236,7 +235,7 @@ print_metaf(struct html *h, enum mandoc_
font = HTMLFONT_NONE;
break;
default:
- abort();
+ return;
}
if (h->metaf) {
Index: mandoc.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mandoc.c,v
retrieving revision 1.111
retrieving revision 1.112
diff -Lmandoc.c -Lmandoc.c -u -p -r1.111 -r1.112
--- mandoc.c
+++ mandoc.c
@@ -38,6 +38,59 @@ static char *time2a(time_t);
enum mandoc_esc
+mandoc_font(const char *cp, int sz)
+{
+ switch (sz) {
+ case 0:
+ return ESCAPE_FONTPREV;
+ case 1:
+ switch (cp[0]) {
+ case 'B':
+ case '3':
+ return ESCAPE_FONTBOLD;
+ case 'I':
+ case '2':
+ return ESCAPE_FONTITALIC;
+ case 'P':
+ return ESCAPE_FONTPREV;
+ case 'R':
+ case '1':
+ return ESCAPE_FONTROMAN;
+ case '4':
+ return ESCAPE_FONTBI;
+ default:
+ return ESCAPE_ERROR;
+ }
+ case 2:
+ switch (cp[0]) {
+ case 'B':
+ switch (cp[1]) {
+ case 'I':
+ return ESCAPE_FONTBI;
+ default:
+ return ESCAPE_ERROR;
+ }
+ case 'C':
+ switch (cp[1]) {
+ case 'B':
+ return ESCAPE_FONTBOLD;
+ case 'I':
+ return ESCAPE_FONTITALIC;
+ case 'R':
+ case 'W':
+ return ESCAPE_FONTCW;
+ default:
+ return ESCAPE_ERROR;
+ }
+ default:
+ return ESCAPE_ERROR;
+ }
+ default:
+ return ESCAPE_ERROR;
+ }
+}
+
+enum mandoc_esc
mandoc_escape(const char **end, const char **start, int *sz)
{
const char *local_start;
@@ -367,47 +420,7 @@ mandoc_escape(const char **end, const ch
switch (gly) {
case ESCAPE_FONT:
- if (*sz == 2) {
- if (**start == 'C') {
- if ((*start)[1] == 'W' ||
- (*start)[1] == 'R') {
- gly = ESCAPE_FONTCW;
- break;
- }
- /*
- * Treat other constant-width font modes
- * just like regular font modes.
- */
- (*start)++;
- (*sz)--;
- } else {
- if ((*start)[0] == 'B' && (*start)[1] == 'I')
- gly = ESCAPE_FONTBI;
- break;
- }
- } else if (*sz != 1) {
- if (*sz == 0)
- gly = ESCAPE_FONTPREV;
- break;
- }
-
- switch (**start) {
- case '3':
- case 'B':
- gly = ESCAPE_FONTBOLD;
- break;
- case '2':
- case 'I':
- gly = ESCAPE_FONTITALIC;
- break;
- case 'P':
- gly = ESCAPE_FONTPREV;
- break;
- case '1':
- case 'R':
- gly = ESCAPE_FONTROMAN;
- break;
- }
+ gly = mandoc_font(*start, *sz);
break;
case ESCAPE_SPECIAL:
if (**start == 'c') {
Index: f.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/roff/esc/f.out_ascii,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/roff/esc/f.out_ascii -Lregress/roff/esc/f.out_ascii -u -p -r1.2 -r1.3
--- regress/roff/esc/f.out_ascii
+++ regress/roff/esc/f.out_ascii
@@ -1,11 +1,18 @@
ESC-F(1) General Commands Manual ESC-F(1)
+
+
N\bNA\bAM\bME\bE
- e\bes\bsc\bc-\b-f\bf - the roff escape f sequence: font changes
+ esc-f - the roff escape f sequence: font changes
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
- numbers: b\bbo\bol\bld\bd_\bi_\bt_\ba_\bl_\bi_\bcroman
- letters: b\bbo\bol\bld\bd_\bi_\bt_\ba_\bl_\bi_\bcb\bba\bac\bck\bk_\bb\bb_\bo\bo_\bl\bl_\bd\bd_\bi\bi_\bt\bt_\ba\ba_\bl\bl_\bi\bi_\bc\bcroman
- multiletter: b\bbo\bol\bld\bd_\bi_\bt_\ba_\bl_\bi_\bcb\bba\bac\bck\bk_\bb\bb_\bo\bo_\bl\bl_\bd\bd_\bi\bi_\bt\bt_\ba\ba_\bl\bl_\bi\bi_\bc\bcroman
+ BEGINTEST
+ numbers: _\bb\bb_\bo\bo_\bl\bl_\bd\bd_\bi\bi_\bt\bt_\ba\ba_\bl\bl_\bi\bi_\bc\bcb\bbo\bol\bld\bd_\bi_\bt_\ba_\bl_\bi_\bcroman
+ letters: b\bbo\bol\bld\bd_\bi_\bt_\ba_\bl_\bi_\bcb\bba\bac\bck\bk_\bb\bb_\bo\bo_\bl\bl_\bd\bd_\bi\bi_\bt\bt_\ba\ba_\bl\bl_\bi\bi_\bc\bcroman
+ multiletter: b\bbo\bol\bld\bdempty_\bi_\bt_\ba_\bl_\bi_\bcback_\bb\bb_\bo\bo_\bl\bl_\bd\bd_\bi\bi_\bt\bt_\ba\ba_\bl\bl_\bi\bi_\bc\bcroman
+ typewriter: romanb\bbo\bol\bld\bdroman_\bi_\bt_\ba_\bl_\bi_\bcroman
+ ENDTEST
+
+
-OpenBSD July 4, 2017 OpenBSD
+OpenBSD December 15, 2018 ESC-F(1)
Index: f.in
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/roff/esc/f.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/roff/esc/f.in -Lregress/roff/esc/f.in -u -p -r1.2 -r1.3
--- regress/roff/esc/f.in
+++ regress/roff/esc/f.in
@@ -1,13 +1,12 @@
-.\" $OpenBSD: f.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $
-.Dd $Mdocdate$
-.Dt ESC-F 1
-.Os
-.Sh NAME
-.Nm esc-f
-.Nd the roff escape f sequence: font changes
-.Sh DESCRIPTION
-numbers: \f3bold\f2italic\f1roman
-.br
+.\" $OpenBSD: f.in,v 1.4 2018/12/15 23:33:20 schwarze Exp $
+.TH ESC-F 1 "December 15, 2018"
+.SH NAME
+esc-f \- the roff escape f sequence: font changes
+.SH DESCRIPTION
+.nf
+BEGINTEST
+numbers: \f4bolditalic\f3bold\f2italic\f1roman
letters: \fBbold\fIitalic\fPback\f(BIbolditalic\fRroman
-.br
-multiletter: \f[B]bold\f[I]italic\f[P]back\f[BI]bolditalic\f[R]roman
+multiletter: \f[B]bold\f[]empty\f[I]italic\f[P]back\f[BI]bolditalic\f[R]roman
+typewriter: \f(CWroman\f(CBbold\f(CRroman\f(CIitalic\fRroman
+ENDTEST
Index: Makefile
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/roff/esc/Makefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lregress/roff/esc/Makefile -Lregress/roff/esc/Makefile -u -p -r1.4 -r1.5
--- regress/roff/esc/Makefile
+++ regress/roff/esc/Makefile
@@ -1,7 +1,8 @@
-# $OpenBSD: Makefile,v 1.11 2015/04/29 18:32:57 schwarze Exp $
+# $OpenBSD: Makefile,v 1.15 2018/12/15 23:33:20 schwarze Exp $
REGRESS_TARGETS = one two multi B c c_man e f h l O o p w z
REGRESS_TARGETS += ignore invalid unsupp
+HTML_TARGETS = f
LINT_TARGETS = B h l O w ignore invalid unsupp
.include <bsd.regress.mk>
--- /dev/null
+++ regress/roff/esc/f.out_html
@@ -0,0 +1,6 @@
+BEGINTEST
+numbers: <b><i>bolditalic</i></b><b>bold</b><i>italic</i>roman
+letters: <b>bold</b><i>italic</i><b>back</b><b><i>bolditalic</i></b>roman
+multiletter: <b>bold</b>empty<i>italic</i>back<b><i>bolditalic</i></b>roman
+typewriter: <span class="Li">roman</span><b>bold</b><span class="Li">roman</span><i>italic</i>roman
+ENDTEST
--- /dev/null
+++ regress/roff/ft/badargs.out_html
@@ -0,0 +1,9 @@
+BEGINTEST
+<br/>
+default font <i></i><i>italic</i> <b><i></i></b><b><i>bold italic</i></b>
+ <span class="Li"></span><span class="Li">typeqriter</span>
+ <span class="Li"></span> <span class="Li">roman</span> <b></b><b>bold</b>
+ <i></i> <i>italic</i> <b></b><b>bold</b> <b>still bold</b>
+ <i></i><i>italic</i> <i></i><i>back to bold</i> <i></i><i>back to italic</i>
+<br/>
+ENDTEST</div>
Index: Makefile
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/roff/ft/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/roff/ft/Makefile -Lregress/roff/ft/Makefile -u -p -r1.2 -r1.3
--- regress/roff/ft/Makefile
+++ regress/roff/ft/Makefile
@@ -1,6 +1,7 @@
-# $OpenBSD: Makefile,v 1.1 2014/07/05 12:33:54 schwarze Exp $
+# $OpenBSD: Makefile,v 1.3 2018/12/15 23:33:20 schwarze Exp $
REGRESS_TARGETS = badargs badargs-mdoc
+HTML_TARGETS = badargs
LINT_TARGETS = badargs badargs-mdoc
SKIP_TMAN = badargs
Index: badargs.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/roff/ft/badargs.out_ascii,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lregress/roff/ft/badargs.out_ascii -Lregress/roff/ft/badargs.out_ascii -u -p -r1.1 -r1.2
--- regress/roff/ft/badargs.out_ascii
+++ regress/roff/ft/badargs.out_ascii
@@ -6,8 +6,11 @@ N\bNA\bAM\bME\bE
ft-badargs - font request with bad arguments
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
- default font b\bbo\bol\bld\bd s\bst\bti\bil\bll\bl b\bbo\bol\bld\bd _\bi_\bt_\ba_\bl_\bi_\bc b\bba\bac\bck\bk t\bto\bo b\bbo\bol\bld\bd _\bb_\ba_\bc_\bk _\bt_\bo _\bi_\bt_\ba_\bl_\bi_\bc
+ BEGINTEST
+ default font _\bi_\bt_\ba_\bl_\bi_\bc _\bb\bb_\bo\bo_\bl\bl_\bd\bd _\bi\bi_\bt\bt_\ba\ba_\bl\bl_\bi\bi_\bc\bc typeqriter roman b\bbo\bol\bld\bd _\bi_\bt_\ba_\bl_\bi_\bc b\bbo\bol\bld\bd s\bst\bti\bil\bll\bl
+ b\bbo\bol\bld\bd _\bi_\bt_\ba_\bl_\bi_\bc b\bba\bac\bck\bk t\bto\bo b\bbo\bol\bld\bd _\bb_\ba_\bc_\bk _\bt_\bo _\bi_\bt_\ba_\bl_\bi_\bc
+ ENDTEST
-OpenBSD July 5, 2014 FT-BADARGS(1)
+OpenBSD December 15, 2018 FT-BADARGS(1)
Index: badargs.in
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/roff/ft/badargs.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/roff/ft/badargs.in -Lregress/roff/ft/badargs.in -u -p -r1.2 -r1.3
--- regress/roff/ft/badargs.in
+++ regress/roff/ft/badargs.in
@@ -1,9 +1,23 @@
-.\" $OpenBSD: badargs.in,v 1.3 2017/07/04 14:53:27 schwarze Exp $
-.TH "FT-BADARGS" 1 "July 5, 2014"
+.\" $OpenBSD: badargs.in,v 1.5 2018/12/16 00:10:03 schwarze Exp $
+.TH "FT-BADARGS" 1 "December 15, 2018"
.SH NAME
ft-badargs \(en font request with bad arguments
.SH DESCRIPTION
+BEGINTEST
+.br
default font
+.ft I
+italic
+.ft BI
+bold italic
+.ft CR
+typeqriter
+.ft CW
+roman
+.ft CB
+bold
+.ft CI
+italic
.ft B
bold
.ft foo
@@ -14,3 +28,6 @@ italic
back to bold
.ft
back to italic
+.ft R
+.br
+ENDTEST
Index: badargs.out_lint
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/roff/ft/badargs.out_lint,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lregress/roff/ft/badargs.out_lint -Lregress/roff/ft/badargs.out_lint -u -p -r1.4 -r1.5
--- regress/roff/ft/badargs.out_lint
+++ regress/roff/ft/badargs.out_lint
@@ -1,2 +1,2 @@
-mandoc: badargs.in:11:7: ERROR: skipping excess arguments: ft ... bogus
-mandoc: badargs.in:9:2: WARNING: unknown font, skipping request: ft foo
+mandoc: badargs.in:25:7: ERROR: skipping excess arguments: ft ... bogus
+mandoc: badargs.in:23:2: WARNING: unknown font, skipping request: ft foo
--
To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-12-16 0:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-16 0:17 mandoc: Yet another round of improvements to manual font selection schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).