Alert and Prompt "OK" button Encoding

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Alert and Prompt "OK" button Encoding

4cop2c
I am trying to run the tutorial of SimpleTablePanes in RAD8. Everything is fine, except that text of the button on the Prompt is mess up. It only show two squares side by side instead of "OK".

I tried the following things to hope there is a change.

1. add -Dfile.encoding=utf8 on JRE VM arguments.

2. add <?xml version="1.0" encoding="UTF-8"?> on top of the bxml file for the SimpleTablePanes class

I am on win 7 with default language set to CHINESE for non unicode program. Please advise.

Thanks for your time.
Jerry
Reply | Threaded
Open this post in threaded view
|

Re: Alert and Prompt "OK" button Encoding

Shengche Hsiao-2

Please refer to http://shengche-hsiao.blogspot.tw/2012/07/pushbutton.html

On Mar 12, 2014 5:33 PM, "4cop2c" <[hidden email]> wrote:
I am trying to run the tutorial of SimpleTablePanes in RAD8. Everything is
fine, except that text of the button on the Prompt is mess up. It only show
two squares side by side instead of "OK".

I tried the following things to hope there is a change.

1. add -Dfile.encoding=utf8 on JRE VM arguments.

2. add <?xml version="1.0" encoding="UTF-8"?> on top of the bxml file for
the SimpleTablePanes class

I am on win 7 with default language set to CHINESE for non unicode program.
Please advise.

Thanks for your time.
Jerry



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Alert-and-Prompt-OK-button-Encoding-tp4022895.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Alert and Prompt "OK" button Encoding

Roger Whitcomb
Hi Jerry,
    Welcome to Pivot!  So, I looked at your code from the link below.  The "OK" text comes from a JSON file inside Pivot itself, and is not translated even in the Chinese version of that file.  Since you are overriding the Theme font with the "PMingLiU" font, my first guess would be that this font does not display the ASCII code points, and that is why you get two squares showing up -- this is the typical display when a particular font does not have glyphs for the characters it is trying to display.  You can confirm that with a Unicode tool such as "BabelMap" on Windows (see http://www.babelstone.co.uk/Software/BabelMap.html). Although I don't know much about it, I think you can use/create a "composite" font that would combine a font face that supports the ASCII range plus the Chinese character set into a single font and then use that as the "theme" font in Pivot.
    Maybe someone else has some experience with this...

~Roger

On 3/12/14 4:33 AM, Shengche Hsiao wrote:

Please refer to http://shengche-hsiao.blogspot.tw/2012/07/pushbutton.html

On Mar 12, 2014 5:33 PM, "4cop2c" <[hidden email]> wrote:
I am trying to run the tutorial of SimpleTablePanes in RAD8. Everything is
fine, except that text of the button on the Prompt is mess up. It only show
two squares side by side instead of "OK".

I tried the following things to hope there is a change.

1. add -Dfile.encoding=utf8 on JRE VM arguments.

2. add <?xml version="1.0" encoding="UTF-8"?> on top of the bxml file for
the SimpleTablePanes class

I am on win 7 with default language set to CHINESE for non unicode program.
Please advise.

Thanks for your time.
Jerry



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Alert-and-Prompt-OK-button-Encoding-tp4022895.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Alert and Prompt "OK" button Encoding

Sandro Martini
Hi all,

> The "OK" text comes from a JSON file inside Pivot itself, and is not translated even in the Chinese version of that file.
otherwise we could translate missing messages :-) , but someone should
help us, volunteers ?

Bye,
Sandro

2014-03-12 16:12 GMT+01:00 Roger Whitcomb <[hidden email]>:

> Hi Jerry,
>     Welcome to Pivot!  So, I looked at your code from the link below.  The
> "OK" text comes from a JSON file inside Pivot itself, and is not translated
> even in the Chinese version of that file.  Since you are overriding the
> Theme font with the "PMingLiU" font, my first guess would be that this font
> does not display the ASCII code points, and that is why you get two squares
> showing up -- this is the typical display when a particular font does not
> have glyphs for the characters it is trying to display.  You can confirm
> that with a Unicode tool such as "BabelMap" on Windows (see
> http://www.babelstone.co.uk/Software/BabelMap.html). Although I don't know
> much about it, I think you can use/create a "composite" font that would
> combine a font face that supports the ASCII range plus the Chinese character
> set into a single font and then use that as the "theme" font in Pivot.
>     Maybe someone else has some experience with this...
>
> ~Roger
>
>
> On 3/12/14 4:33 AM, Shengche Hsiao wrote:
>
> Please refer to http://shengche-hsiao.blogspot.tw/2012/07/pushbutton.html
>
> On Mar 12, 2014 5:33 PM, "4cop2c" <[hidden email]> wrote:
>>
>> I am trying to run the tutorial of SimpleTablePanes in RAD8. Everything is
>> fine, except that text of the button on the Prompt is mess up. It only
>> show
>> two squares side by side instead of "OK".
>>
>> I tried the following things to hope there is a change.
>>
>> 1. add -Dfile.encoding=utf8 on JRE VM arguments.
>>
>> 2. add <?xml version="1.0" encoding="UTF-8"?> on top of the bxml file for
>> the SimpleTablePanes class
>>
>> I am on win 7 with default language set to CHINESE for non unicode
>> program.
>> Please advise.
>>
>> Thanks for your time.
>> Jerry
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-pivot-users.399431.n3.nabble.com/Alert-and-Prompt-OK-button-Encoding-tp4022895.html
>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Alert and Prompt "OK" button Encoding

Roger Whitcomb
Well, it's not that it's missing, but I think the Chinese translator
just chose not to translate "OK" ... ;-)

~Roger

On 3/12/14 9:04 AM, Sandro Martini wrote:

> Hi all,
>
>> The "OK" text comes from a JSON file inside Pivot itself, and is not translated even in the Chinese version of that file.
> otherwise we could translate missing messages :-) , but someone should
> help us, volunteers ?
>
> Bye,
> Sandro
>
> 2014-03-12 16:12 GMT+01:00 Roger Whitcomb <[hidden email]>:
>> Hi Jerry,
>>      Welcome to Pivot!  So, I looked at your code from the link below.  The
>> "OK" text comes from a JSON file inside Pivot itself, and is not translated
>> even in the Chinese version of that file.  Since you are overriding the
>> Theme font with the "PMingLiU" font, my first guess would be that this font
>> does not display the ASCII code points, and that is why you get two squares
>> showing up -- this is the typical display when a particular font does not
>> have glyphs for the characters it is trying to display.  You can confirm
>> that with a Unicode tool such as "BabelMap" on Windows (see
>> http://www.babelstone.co.uk/Software/BabelMap.html). Although I don't know
>> much about it, I think you can use/create a "composite" font that would
>> combine a font face that supports the ASCII range plus the Chinese character
>> set into a single font and then use that as the "theme" font in Pivot.
>>      Maybe someone else has some experience with this...
>>
>> ~Roger
>>
>>
>> On 3/12/14 4:33 AM, Shengche Hsiao wrote:
>>
>> Please refer to http://shengche-hsiao.blogspot.tw/2012/07/pushbutton.html
>>
>> On Mar 12, 2014 5:33 PM, "4cop2c" <[hidden email]> wrote:
>>> I am trying to run the tutorial of SimpleTablePanes in RAD8. Everything is
>>> fine, except that text of the button on the Prompt is mess up. It only
>>> show
>>> two squares side by side instead of "OK".
>>>
>>> I tried the following things to hope there is a change.
>>>
>>> 1. add -Dfile.encoding=utf8 on JRE VM arguments.
>>>
>>> 2. add <?xml version="1.0" encoding="UTF-8"?> on top of the bxml file for
>>> the SimpleTablePanes class
>>>
>>> I am on win 7 with default language set to CHINESE for non unicode
>>> program.
>>> Please advise.
>>>
>>> Thanks for your time.
>>> Jerry
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://apache-pivot-users.399431.n3.nabble.com/Alert-and-Prompt-OK-button-Encoding-tp4022895.html
>>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Alert and Prompt "OK" button Encoding

4cop2c
Dear All,

Thanks for all the suggestions and ideas.
My simple solution is to use

Theme.getTheme().setFont(new Font("PMingLiU", Font.PLAIN, 12));

in the initialize function before calling the TablePane from the name space. So it looks like the following:

public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
    Theme.getTheme().setFont(new Font("PMingLiU", Font.PLAIN, 12));
    tablePane = (TablePane)namespace.get("tablePane");
     public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {


The words are now showing OK in Chinese. Thanks!

Regards,
Jerry