summaryrefslogtreecommitdiffstats
path: root/term_ascii.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-06-25 18:53:14 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-06-25 18:53:14 +0000
commite38e92fb342e1fd7972ac583e284ef136e875f84 (patch)
treec5a249ab316aec4cc0440968a92bd0ebf5dcaa52 /term_ascii.c
parentc085e34da24e96f30415b3bb39ccf1d20b32fd83 (diff)
downloadmandoc-e38e92fb342e1fd7972ac583e284ef136e875f84.tar.gz
Initial chunks for variable-width fonts. Pushes all width calculations
in mdoc_term.c and man_term.c down into term.c. This is still not implemented in term.c, although stubs for width calculations are in place. From now on, offset, rmargin, and other layout variables are abstract screen widths. They will resolve to the the familiar values for -Tascii but -Tps will eventually use points instead of chars.
Diffstat (limited to 'term_ascii.c')
-rw-r--r--term_ascii.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/term_ascii.c b/term_ascii.c
index ade99da3..1b0ed345 100644
--- a/term_ascii.c
+++ b/term_ascii.c
@@ -35,6 +35,7 @@ static void ascii_letter(struct termp *, char);
static void ascii_begin(struct termp *);
static void ascii_advance(struct termp *, size_t);
static void ascii_end(struct termp *);
+static size_t ascii_width(const struct termp *, char);
void *
@@ -47,12 +48,16 @@ ascii_alloc(char *outopts)
if (NULL == (p = term_alloc(TERMENC_ASCII)))
return(NULL);
+ p->tabwidth = 5;
+ p->defrmargin = 78;
+
p->type = TERMTYPE_CHAR;
p->letter = ascii_letter;
p->begin = ascii_begin;
p->end = ascii_end;
p->endline = ascii_endline;
p->advance = ascii_advance;
+ p->width = ascii_width;
toks[0] = "width";
toks[1] = NULL;
@@ -74,6 +79,14 @@ ascii_alloc(char *outopts)
}
+static size_t
+ascii_width(const struct termp *p, char c)
+{
+
+ return(1);
+}
+
+
void
ascii_free(void *arg)
{