Re: [wmii] UTF-8 text issue in wmii-3.6

From: sqweek <sqweek_AT_gmail.com>
Date: Wed, 30 Jul 2008 11:53:33 +0800

On Wed, Jul 30, 2008 at 11:38 AM, sqweek <sqweek_AT_gmail.com> wrote:
> On Wed, Jul 30, 2008 at 10:20 AM, Anthony Martin <ality_AT_pbrane.org> wrote:
>> I started the process of explaining how X draws
>> a character with X(mb|wc|utf8)DrawString but
>> about half way through, I was confused.
>
> I'd love to hear it anyway.

 Hm, maybe I should give you an idea of my current understanding.
 It starts with some text, which is somehow encoded into numbers.
Hopefully the encoding is utf-8 as I think wmii assumes it. Locale
probably affects things here...
 Anyway, the text can be decoded into a sequence of codepoints, which
is what we are really interested in for dealing with fonts. That just
about covers what I _know_ about the situation, the remainder is
supposition:

 Logically, a font file must be a mapping from codepoint to glyph. It
shouldn't matter what codepage the font was designed for, since I'm
sure eg. the glyph め has equivalent codepoints in shift_JIS and
iso10646. If you always work internally with iso10646 you ought to be
able to map the codepoints from other codepages when loading fonts.
 Um, I'm probably getting sidetracked. So you've decoded some text to
get codepoints, and now you need to draw them. You sequentially step
through the font list looking for that codepoint, get the associated
glyph and draw it.
 It all seems pretty simple actually, which is probably a sure sign
I'm way off X11's implementation ;)
-sqweek
Received on Wed Jul 30 2008 - 03:53:33 UTC

This archive was generated by hypermail 2.2.0 : Wed Jul 30 2008 - 04:00:07 UTC