This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PATCH: xlib support for 16-bit characters when rendering text
- From: Tom Tromey <tromey at redhat dot com>
- To: "Scott Gilbertson" <scottg at mantatest dot com>
- Cc: <java-patches at gcc dot gnu dot org>
- Date: 10 Feb 2003 21:17:39 -0700
- Subject: Re: PATCH: xlib support for 16-bit characters when rendering text
- References: <021701c2cbd0$932162b0$3c16a8c0@mantatest.com>
- Reply-to: tromey at redhat dot com
>>>>> "Scott" == Scott Gilbertson <scottg@mantatest.com> writes:
Scott> The following patch (taken against the 3.3 branch) causes the
Scott> xlib peers to use 16-bit characters when rendering text. I
Scott> have tried it with ISO10646-1 and 8-bit fonts, and it seems OK
Scott> to me.
Scott> + XChar2b xwchars[length];
Scott> + for (int i=0; i<length; i++)
Scott> + {
Scott> + XChar2b* xc = &(xwchars[i]);
Scott> + jchar jc = txt[i];
Scott> + xc->byte1 = (jc >> 8) & 0xff;
Scott> + xc->byte2 = jc & 0xff;
Scott> + }
Scott> + return XTextWidth16(fontStruct, xwchars, length);
Is the argument to XTextWidth16 really UCS-2?
I'm wondering if it is locale dependent or something like that.
Do you have a reference to what is correct?
I'm concerned that this may work in some situations but not others.
In that case we'd need to use some other method to get the encoding
correct.
Tom