From fb7ea55796176565141285c5c6de1d3127655116 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 16 Dec 2018 00:17:02 +0000 Subject: 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. --- roff_validate.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'roff_validate.c') diff --git a/roff_validate.c b/roff_validate.c index 5593dd8a..d4cf6f6b 100644 --- a/roff_validate.c +++ b/roff_validate.c @@ -1,4 +1,4 @@ -/* $Id: roff_validate.c,v 1.14 2018/12/14 05:18:03 schwarze Exp $ */ +/* $Id: roff_validate.c,v 1.15 2018/12/16 00:17:02 schwarze Exp $ */ /* * Copyright (c) 2010, 2017, 2018 Ingo Schwarze * @@ -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); } -- cgit v1.2.3-56-ge451