[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libcaca] Re: updated patches for libcaca
sorry, gmail sent it as base64 because the quoted text included some
box drawing characters. here is the unquoted text:
On 6/28/07, Sam Hocevar <sam@zoy.org> wrote:
On Wed, Jun 27, 2007, Ben Wiley Sittler wrote:
[snip]
If you have any idea on how to solve this mess without making it too
difficult for the application writer, let me know ;-)
one solution is to write your app's graphical parts entirely in terms
of fullwidth cells of either one fullwidth character or two narrow
characters, and have code to convert fullwidth graphic characters to
halfwidth pairs when appropriate for the locale. myman does this when
run with the '-2' command-line parameter. this is complex but displays
well in all situations. however, i do not recommend this in general
because the cost of the complexity is greater than the benefit of
portability in most cases.
a simpler solution is to maintain the locale-independent fullwidth
code, but also call wcwidth, and when they disagree print a plain
ASCII fallback (if wcwidth > locale-independent width) or add a space
or other narrow character to widen it to fullwidth (if wcwidth <
locale-independent width). this makes apps completely portable, but
means characters whose localized width is larger than the standard
width will not be displayed in that locale. this means layout will
always be correct, but some data may be lost (much like when
converting to ascii.) this is the solution i recommend for
libcaca/libcucul for now, because it's not too complex and it doesn't
make things difficult for the programmers using the library. it also
keeps data in a portable form except when displaying it on the
terminal.
> 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?
You're probably right that a working game is needed. I just don't
feel motivated to work on the vertical scrolling one at the moment
because the code was really ugly and buggy and I feel it needs a rewrite
anyway.
i understand. nonetheless, it was by converting the old
vertical-scroller to work with the current libcaca/libcucul that i
learned your APIs. is cacatris a better example? (i haven't yet read
that code.)
-ben
--
This is the libcaca mailing-list, see http://libcaca.zoy.org/
Trouble unsubscribing? Please contact <sam@zoy.org>
List archives are at http://libcaca.zoy.org/list/