This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: xlib support for 16-bit characters when rendering text


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]