- if (ext->squeeze_blank_lines
- && line_num > first
- && ext->lines[line_num].char_cnt == 0
- && ext->lines[line_num - 1].char_cnt == 0)
- continue;
-
- /* Output every character in the line in the appropriate
- manner. */
- n_passes = 1;
- bp = ep = p;
- n_chars = 0;
- advance_to_left_margin (this);
- for (;;)
- {
- while (ep < end_p && attr == (*ep & 0x0300))
- ep++;
- if (output_shorts (this, bp, ep))
- n_passes = 2;
- n_chars += ep - bp;
- bp = ep;
-
- if (bp >= end_p)
- break;
-
- /* Turn off old font. */
- if (attr != (OUTP_F_R << 8))
- {
- struct fixed_string *off;
-
- switch (attr)
- {
- case OUTP_F_I << 8:
- off = &ext->fonts[FSTY_OFF | FSTY_ITALIC];
- break;
- case OUTP_F_B << 8:
- off = &ext->fonts[FSTY_OFF | FSTY_BOLD];
- break;
- case OUTP_F_BI << 8:
- off = &ext->fonts[FSTY_OFF | FSTY_BOLD_ITALIC];
- break;
- default:
- assert (0);
- abort ();
- }
- if (off)
- output_string (this, ls_c_str (off), ls_end (off));
- }
-
- /* Turn on new font. */
- attr = (*bp & 0x0300);
- if (attr != (OUTP_F_R << 8))
- {
- struct fixed_string *on;
-
- switch (attr)
- {
- case OUTP_F_I << 8:
- on = &ext->fonts[FSTY_ON | FSTY_ITALIC];
- break;
- case OUTP_F_B << 8:
- on = &ext->fonts[FSTY_ON | FSTY_BOLD];
- break;
- case OUTP_F_BI << 8:
- on = &ext->fonts[FSTY_ON | FSTY_BOLD_ITALIC];
- break;
- default:
- assert (0);
- abort ();
- }
- if (on)
- output_string (this, ls_c_str (on), ls_end (on));
- }
-
- ep = bp + 1;
- }
- if (n_passes > 1)
- {
- char ch;
-
- return_carriage (this, n_chars);
- n_chars = 0;
- bp = ep = p;
- for (;;)
- {
- while (ep < end_p && (*ep & 0x0300) == (OUTP_F_R << 8))
- ep++;
- if (ep >= end_p)
- break;
- output_char (this, ep - bp, ' ');
-
- switch (*ep & 0x0300)
- {
- case OUTP_F_I << 8:
- ch = '_';
- break;
- case OUTP_F_B << 8:
- ch = *ep;
- break;
- case OUTP_F_BI << 8:
- ch = *ep;
- n_passes = 3;
- break;
- default:
- assert (0);
- abort ();
- }
- output_char (this, 1, ch);
- n_chars += ep - bp + 1;
- bp = ep + 1;
- ep = bp;
- }
- }
- if (n_passes > 2)
- {
- return_carriage (this, n_chars);
- bp = ep = p;
- for (;;)
- {
- while (ep < end_p && (*ep & 0x0300) != (OUTP_F_BI << 8))
- ep++;
- if (ep >= end_p)
- break;
- output_char (this, ep - bp, ' ');
- output_char (this, 1, '_');
- bp = ep + 1;
- ep = bp;
- }
- }