Changeset 1221
- Timestamp:
- 10/22/06 19:40:55 (7 years ago)
- Location:
- libcaca/trunk/cucul
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/cucul/canvas.c
r1218 r1221 54 54 * The behaviour when printing non-printable characters or invalid UTF-32 55 55 * characters is undefined. To print a sequence of bytes forming an UTF-8 56 * character instead of an UTF-32 character, use the cucul_putstr() function 57 * instead. 56 * character instead of an UTF-32 character, use the cucul_putstr() function. 58 57 * 59 58 * This function never fails. … … 133 132 * 134 133 * If the coordinates are outside the canvas boundaries, a space (0x20) 135 * is returned. FIXME: explain CUCUL_MAGIC_FULLWIDTH 134 * is returned. 135 * 136 * A special exception is when CUCUL_MAGIC_FULLWIDTH is returned. This 137 * value is guaranteed not to be a valid Unicode character, and indicates 138 * that the character at the left of the requested one is a fullwidth 139 * character. 136 140 * 137 141 * This function never fails. … … 270 274 * - \c EINVAL A mask was specified but the mask size and source canvas 271 275 * size do not match. 276 * 277 * FIXME: this function may corrupt the canvas if fullwidth characters 278 * appear at odd places. 272 279 * 273 280 * \param dst The destination canvas. -
libcaca/trunk/cucul/export.c
r1191 r1221 225 225 uint8_t fg, bg; 226 226 227 if(ch == CUCUL_MAGIC_FULLWIDTH) 228 continue; 229 227 230 fg = ((attr & 0xffff) == CUCUL_COLOR_DEFAULT) ? 228 231 0x10 : palette[_cucul_argb32_to_ansi4fg(attr)]; … … 298 301 uint8_t bg = palette[_cucul_argb32_to_ansi4bg(lineattr[x])]; 299 302 uint32_t ch = linechar[x]; 303 304 if(ch == CUCUL_MAGIC_FULLWIDTH) 305 ch = '?'; 300 306 301 307 if(fg != prevfg || bg != prevbg) … … 378 384 len++) 379 385 { 380 if(linechar[x + len] <= 0x00000020) 386 if(linechar[x + len] == CUCUL_MAGIC_FULLWIDTH) 387 ; 388 else if(linechar[x + len] <= 0x00000020) 381 389 cur += sprintf(cur, " "); 382 390 else if(linechar[x + len] < 0x00000080) … … 451 459 for(i = 0; i < len; i++) 452 460 { 453 if(linechar[x + i] <= 0x00000020) 461 if(linechar[x + i] == CUCUL_MAGIC_FULLWIDTH) 462 ; 463 else if(linechar[x + i] <= 0x00000020) 454 464 cur += sprintf(cur, " "); 455 465 else if(linechar[x + i] < 0x00000080) … … 511 521 uint8_t bg = palette[_cucul_argb32_to_ansi4bg(attr)]; 512 522 uint32_t ch = linechar[x]; 523 524 if(ch == CUCUL_MAGIC_FULLWIDTH) 525 continue; 513 526 514 527 if((attr & 0xffff) == CUCUL_COLOR_DEFAULT) … … 698 711 cv->width * 6, cv->height * 10); 699 712 700 cur += sprintf(cur, " <g id=\"mainlayer\" font-size=\"12\">\n"); 713 cur += sprintf(cur, " <g id=\"mainlayer\" font-size=\"10\"" 714 " style=\"font-family: monospace\">\n"); 701 715 702 716 /* Background */ … … 724 738 uint32_t ch = *linechar++; 725 739 740 if(ch == ' ' || ch == CUCUL_MAGIC_FULLWIDTH) 741 { 742 lineattr++; 743 continue; 744 } 745 726 746 cur += sprintf(cur, "<text style=\"fill:#%.03x\" " 727 747 "x=\"%d\" y=\"%d\">", 728 748 _cucul_argb32_to_rgb12fg(*lineattr++), 729 x * 6, (y * 10) + 10); 749 x * 6, (y * 10) + 8); 750 730 751 if(ch < 0x00000020) 731 752 *cur++ = '?';
Note: See TracChangeset
for help on using the changeset viewer.
