[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcaca] Re: updated patches for libcaca



updated version of the patch, and this time it also adds mirrored
versions of a bunch more box drawing characters from cp437.

http://zoehep.xent.com/~bsittler/libcaca-trunk-1123.diff

* caca/driver_x11: fixed data for left and right tee

* cucul/transform.c: add flip, flop, and rotate data for addition
cp437 box drawings

the latest myman-0.7pre1 supports flip, flop and rotate using the '~'
hotkey. same URL as before:

http://zoehep.xent.com/~bsittler/myman-0.7pre1.tar.gz

also it supports interchanging of horizontal and vertical coordinates
and corresponding transformation of (some) characters. use the '/'
hotkey to see that. should cucul maybe support this operation too?
this is a 90 degree rotation + a flip. so, e.g.,

abc
-+-
d|e

becomes

a|d
b+-
c|e

note that the '|' and '-' are interchanged, and so are box drawings
and some other characters. does this seem useful for libcucul? is it
there already and i missed it?

thanks,
-ben

On 6/27/07, Ben Wiley Sittler <bsittler@gmail.com> wrote:
hi, i just updated to your newest version (revision 1123) and it works
well. you cleaned up and rewrote my patches, and the code is much
cleaner now, thank you!

however, there is a problem in the x11 driver. two characters had
their data reversed. a patch is attached.

* caca/driver_x11: fixed data for left and right tee

the patch is also at:

http://zoehep.xent.com/~bsittler/libcaca-trunk-1123.diff

i also notice that the slang driver prints incorrect output for
fullwidth characters. for instance,  'Hello' becomes 'HHeelloo', but
'H e l l o ' is a much better approximation. maybe there should be a
cucul_utf32_to_ascii-like function that converts to a string of ASCII
characters instead...

and finally, it looks like the ncurses changes are not merged yet. let
me know if you would like me to clean that up more.

thanks,
-ben

On 6/27/07, Ben Wiley Sittler <bsittler@gmail.com> wrote:
> On 6/27/07, Sam Hocevar <sam@zoy.org> wrote:
> > On Tue, Jun 26, 2007, Ben Wiley Sittler wrote:
> [snip]
> > > * caca/driver_slang.c: when the libslang does not support utf-8
> > > output, use ASCII approximations for vt-100 and cp437 graphics
> > > characters
> >
> >    In this patch (and in the ncurses one) there are plenty of cch2
> > assignations even for characters that are not fullwidth (for instance
> > 0x00002591). Can you explain that a bit more?
>
> in that particular case (U+2591) cch2 is not needed, since (AFAIK) no
> double-byte charsets included it. however, here is an explanation of
> why i did that for all characters that might need right-extension
> during halfwidth approximation of fullwidth display:
>
> so far libcaca's idea of which characters are fullwidth is hardcoded,
> and does not vary by locale. however, in fact this data should vary by
> locale. libcaca should use wcwidth to determine when a character is
> fullwidth. in fact east asian (CJK) locales using double-byte
> encodings (GB18030, Shift_JIS, EUC-KR, etc.) have most characters
> outside of plain ASCII as fullwidth because this reflects the
> double-byte encoding of the non-ASCII characters. so if you use e.g.
> "kterm" on linux with LANG=japanese, you will see that many characters
> libcaca believes to be non-fullwidth (greek letters, for instance) are
> in fact fullwidth. wcwidth (after setlocale) reflects this.
>
> so when approximating a unicode character using ASCII, if the unicode
> character might be fullwidth in some locales and would need something
> other than a blank space printed after it, i defined a cch2. i hope
> that someday libcaca will support the double-byte CJK locales, using
> the ncursesw backend at least (ncursesw already internally converts
> unicode to the locale character set and uses the locale's wcwidth data
> if you use the wide-character APIs instead of the byte APIs -- myman's
> internal ncursesw backend uses the wide-character APIs for this
> reason.)
>
> > > also, there is an updated MyMan to better support the new features.
> > > same URL as the old version:
> > >
> > > http://zoehep.xent.com/~bsittler/myman-0.7pre1.tar.gz
> >
> >    Excellent! You seem to be the first external developer ever to really
> > use libcaca for anything else than its bitmap->text capabilities.
>
> hopefully the first of many :)
>
> in my opinion a lot more people would use it if the
> vertically-scrolling ttyvaders were released. having a horizontal game
> would be nice too, but why not release now the one that already works
> and is a good example of libcaca capabilities?
>
> -ben
>


Index: caca/driver_x11.c
===================================================================
--- caca/driver_x11.c	(revision 1123)
+++ caca/driver_x11.c	(working copy)
@@ -583,9 +583,9 @@
             0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
             /* 0x2510 - 0x251f: â?? . . . â?? . . . â?? . . . â?? . . . */
             0x14, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00,
-            0x44, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00,
+            0x44, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00,
             /* 0x2520 - 0x252f: . . . . â?¤ . . . . . . . â?¬ . . . */
-            0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00,
             0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
             /* 0x2530 - 0x253f: . . . . â?´ . . . . . . . â?¼ . . . */
             0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00,
Index: cucul/transform.c
===================================================================
--- cucul/transform.c	(revision 1123)
+++ cucul/transform.c	(working copy)
@@ -274,8 +274,14 @@
          0x250f, 0x2513, /* â?? â?? */
          0x2517, 0x251b, /* â?? â?? */
          0x2523, 0x252b, /* â?£ â?« */
+         0x2552, 0x2555, /* â?? â?? */
+         0x2558, 0x255b, /* â?? â?? */
+         0x2553, 0x2556, /* â?? â?? */
+         0x2559, 0x255c, /* â?? â?? */
          0x2554, 0x2557, /* â?? â?? */
          0x255a, 0x255d, /* â?? â?? */
+         0x255e, 0x2561, /* â?? â?¡ */
+         0x255f, 0x2562, /* â?? â?¢ */
          0x2560, 0x2563, /* â?  â?£ */
          0x2574, 0x2576, /* â?´ â?¶ */
          0x2578, 0x257a, /* â?¸ â?º */
@@ -360,6 +366,12 @@
          0x2554, 0x255a, /* â?? â?? */
          0x2557, 0x255d, /* â?? â?? */
          0x2566, 0x2569, /* â?¦ â?© */
+         0x2552, 0x2558, /* â?? â?? */
+         0x2555, 0x255b, /* â?? â?? */
+         0x2564, 0x2567, /* â?¤ â?§ */
+         0x2553, 0x2559, /* â?? â?? */
+         0x2556, 0x255c, /* â?? â?? */
+         0x2565, 0x2568, /* â?¥ â?¨ */
          0x2575, 0x2577, /* â?µ â?· */
          0x2579, 0x257b, /* â?¹ â?» */
          0
@@ -458,6 +470,14 @@
          0x2557, 0x255a, /* â?? â?? */
          0x2560, 0x2563, /* â?  â?£ */
          0x2566, 0x2569, /* â?¦ â?© */
+         0x2552, 0x255b, /* â?? â?? */
+         0x2555, 0x2558, /* â?? â?? */
+         0x255e, 0x2561, /* â?? â?¡ */
+         0x2564, 0x2567, /* â?¤ â?§ */
+         0x2553, 0x255c, /* â?? â?? */
+         0x2556, 0x2559, /* â?? â?? */
+         0x255f, 0x2562, /* â?? â?¢ */
+         0x2565, 0x2568, /* â?¥ â?¨ */
          0x2574, 0x2576, /* â?´ â?¶ */
          0x2575, 0x2577, /* â?µ â?· */
          0x2578, 0x257a, /* â?¸ â?º */