Changeset 4299
- Timestamp:
- 01/24/10 22:43:19 (3 years ago)
- File:
-
- 1 edited
-
libcaca/trunk/caca/codec/export.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/codec/export.c
r4235 r4299 1019 1019 * + \fB + \fI + \fR (9) 1020 1020 * + 4 bytes = 33 1021 * Each line has a \n (1) 1021 * Each line has a \n (1) and maybe 0xc2 0xa0 (2) 1022 1022 * Header has .nf\n (3) 1023 1023 */ 1024 *bytes = 3 + cv->height + (cv->width * cv->height * 33);1024 *bytes = 3 + cv->height * 3 + (cv->width * cv->height * 33); 1025 1025 cur = data = malloc(*bytes); 1026 1026 … … 1041 1041 uint32_t bg = _rgb_to_troff_index(_caca_attr_to_rgb24bg(lineattr[x])); 1042 1042 uint32_t ch = linechar[x]; 1043 1043 1044 if(fg != prevfg || !started) 1044 1045 cur += sprintf(cur, "\\m[%s]", colors[fg]); … … 1063 1064 } 1064 1065 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 1065 1070 cur += sprintf(cur, "\n"); 1066 1071 }
Note: See TracChangeset
for help on using the changeset viewer.
