version 1.243, 2015/01/21 20:33:25 |
version 1.244, 2015/01/31 00:12:41 |
Line 363 term_fontpush(struct termp *p, enum termfont f) |
|
Line 363 term_fontpush(struct termp *p, enum termfont f) |
|
p->fontq[p->fonti] = f; |
p->fontq[p->fonti] = f; |
} |
} |
|
|
/* Retrieve pointer to current font. */ |
|
const enum termfont * |
|
term_fontq(struct termp *p) |
|
{ |
|
|
|
return(&p->fontq[p->fonti]); |
|
} |
|
|
|
/* Flush to make the saved pointer current again. */ |
/* Flush to make the saved pointer current again. */ |
void |
void |
term_fontpopq(struct termp *p, const enum termfont *key) |
term_fontpopq(struct termp *p, int i) |
{ |
{ |
|
|
while (p->fonti >= 0 && key < p->fontq + p->fonti) |
assert(i >= 0); |
p->fonti--; |
if (p->fonti > i) |
assert(p->fonti >= 0); |
p->fonti = i; |
} |
} |
|
|
/* Pop one font off the stack. */ |
/* Pop one font off the stack. */ |
Line 568 encode1(struct termp *p, int c) |
|
Line 560 encode1(struct termp *p, int c) |
|
if (p->col + 6 >= p->maxcols) |
if (p->col + 6 >= p->maxcols) |
adjbuf(p, p->col + 6); |
adjbuf(p, p->col + 6); |
|
|
f = *term_fontq(p); |
f = p->fontq[p->fonti]; |
|
|
if (TERMFONT_UNDER == f || TERMFONT_BI == f) { |
if (TERMFONT_UNDER == f || TERMFONT_BI == f) { |
p->buf[p->col++] = '_'; |
p->buf[p->col++] = '_'; |
Line 600 encode(struct termp *p, const char *word, size_t sz) |
|
Line 592 encode(struct termp *p, const char *word, size_t sz) |
|
* character by character. |
* character by character. |
*/ |
*/ |
|
|
if (*term_fontq(p) == TERMFONT_NONE) { |
if (p->fontq[p->fonti] == TERMFONT_NONE) { |
if (p->col + sz >= p->maxcols) |
if (p->col + sz >= p->maxcols) |
adjbuf(p, p->col + sz); |
adjbuf(p, p->col + sz); |
for (i = 0; i < sz; i++) |
for (i = 0; i < sz; i++) |