PATCH: xlib support for 16-bit characters when rendering text
Tom Tromey
tromey@redhat.com
Tue Feb 11 04:28:00 GMT 2003
>>>>> "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
More information about the Java-patches
mailing list