Changeset 4299


Ignore:
Timestamp:
Jan 24, 2010, 10:43:19 PM (7 years ago)
Author:
pterjan
Message:
  • Always draw all background in troff output
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/codec/export.c

    r4235 r4299  
    10191019     *  + \fB + \fI + \fR (9)
    10201020     *  + 4 bytes = 33
    1021      * Each line has a \n (1)
     1021     * Each line has a \n (1) and maybe 0xc2 0xa0 (2)
    10221022     * Header has .nf\n (3)
    10231023     */
    1024     *bytes = 3 + cv->height + (cv->width * cv->height * 33);
     1024    *bytes = 3 + cv->height * 3 + (cv->width * cv->height * 33);
    10251025    cur = data = malloc(*bytes);
    10261026
     
    10411041            uint32_t bg = _rgb_to_troff_index(_caca_attr_to_rgb24bg(lineattr[x]));
    10421042            uint32_t ch = linechar[x];
     1043
    10431044            if(fg != prevfg || !started)
    10441045                cur += sprintf(cur, "\\m[%s]", colors[fg]);
     
    10631064        }
    10641065
     1066        /* Add unbreakable space at the end of lines, else spaces are dropped */
     1067        if(x > 0 && linechar[x-1] == ' ')
     1068            cur += sprintf(cur-1, "%c%c", 0xc2, 0xa0)-1;
     1069
    10651070        cur += sprintf(cur, "\n");
    10661071    }
Note: See TracChangeset for help on using the changeset viewer.