discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Language Setup Document (Re: Text drawing bug - gaps after 16th char


From: Kazunobu Kuriyama
Subject: Re: Language Setup Document (Re: Text drawing bug - gaps after 16th character ...)
Date: Tue, 08 Jul 2003 19:18:15 +0900
User-agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.0.0) Gecko/20020614

(Sorry for bothering you again, but I mistakenly sent an email that I hadn't
finished writing. Please throw that garbage away.)

Pete French wrote:

>> The current implementation of XGFont.m uses only XDrawString to draw
>> literal strings on the screen.
>
>
> Was this not fixed ? I saw a patch go round a very long time ago that
> seemed to be to fix it to draw muti-byte UTF8 encodings on the screen
> didnt I ?

Do you remenber where and when you saw the patch? (I join the two mailing
lists discuss-gnustep and bug-gnustep. I've never seen it there since
I joned the lists about a month ago. Is there other useful list?  Or is
it a private communication?)

It might be the one I privately sent to Adam Fedor several weeks ago.
The code I added to the source sums up a few hundred lines, making
the source code twice as much as it has been.  So I have to deal with
some legal stuff together with the Free Software Foundation for the patch
to be applied to GNUstep officially.  I asked the FSF to send me a form for
that procedure.  But I haven't received it yet.  That's why I can't
make it public.

What I can say now is that the patch is not adopted yet. As you know,
I'm not in a position to give you an authorized answer to your question.

>
>
>> NSGlyph*. In other words,
>> it works fine only for single byte charaters. (This may be a subtle
>> point for those who exclusively
>> use single byte characters.)
>
>
> What do you mean by 'multi-byte' here ? That deoends on the encoding
> does it
> not ? I used to use xlib all the time, and one pof the charatres I
> displayed
> was a UK pound sign. This is encoded at C3 A8 as far as I am aware (thats
> certainly how I store it) so I wold have thought i counted a "multi-byte"
> and it certainly displayed properly under xlib. On the other hand it
> may be
> that the multi-byte encoding can be mapped to a single byte
> representing the
> character.
>
> -bat.
>

I'm afraid the argument above is based on misunderstanding.

I used 'multi-byte' in a usual sense in C.  That is another concept
different from encoding, although they are working together almost
all the time. Basically, there's no dependency between them.

As for the UK pound sign you mentioned, it appears that it is
encoded in UTF8. In this context, the concept of multi-byte characters
doesn't make sence; you can't say 'C3 A8' represents a multi-byte
character.

I guess 'C3 A8' is converted into a 4 byte data encoded in unicode
in the internal of your GNUstep application (perhaps, through an
NSString instance). If the resulting code belongs to the range
[00000000, 0000007f], it is identical to that used for ASCII or
its variations and hence you can display it with XDrawString through
a trivial conversion (by taking 1 byte from the 4 byte data).
This is just what the current implementation of XGFont.m does.
It always ignores the rest of the bytes.  However, this fact
won't be manifested if you only use unicode characters belonging
to the range [00000000, 0000007f] (i.e., almost all characters used
in European countries).  I think that's why you thought you counted
multi-byte characters.

As for the last question, since there's no one-to-one mapping from
a set of several ten thousand elements to a set of 256 elements,
it is impossible for a multi-byte character to be represented with
a single byte unless it is the one specified in ISO8859-1 or
whatsoever similar to this.

- KK





reply via email to

[Prev in Thread] Current Thread [Next in Thread]