You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Le Zhou <le...@gmail.com> on 2011/04/25 16:55:07 UTC
Calender display problem
Hi, everyone
The Calender component has one kinda display problem on my windows XP
platform. Value of month and values of day of week are shown as sequences of
squares as follows:
[image: calendar.png]
JRE on my windows is of version 1.6.0_25.
Can anyone tell me how to fix this problem? Thanks a lot!
Re: Calender display problem
Posted by Sandro Martini <sa...@gmail.com>.
Hi,
you can even try to set your font in a custom Terra json configuration file,
and pass it in startup parameters to your application ... some info here:
http://apache-pivot-users.399431.n3.nabble.com/Asian-characters-td1996531.html
Bye,
Sandro
--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Calender-display-problem-tp2861245p2870212.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Re: Calender display problem
Posted by Greg Brown <gk...@verizon.net>.
ScriptApplication is simply a shortcut to implementing the Application interface. Most "real-world" applications will probably implement Application. The tutorial contains several examples that demonstrate how to do this, including the introductory "Hello World" example. You just need to set the font before you create any UI elements.
And, as Sandro noted, you can also do this dynamically via a custom theme descriptor.
G
On Apr 27, 2011, at 8:25 AM, Le Zhou wrote:
> Hi, Greg,
>
> I'm not sure i understand your reply above right...
>
> Do i have to change my app to "extends Application" instead of "extends Window implements Bindable"
>
> As most examples in the tutorial, if my app extends Window implements Bindable, I start my app by the ScriptApplication class, and i can use the get(bxml:id) method of the argument "Map<String, Object>" of the initialize method to get instance of each component, and add Listner to it
>
> i haven't use the "extends Application" approach yet, would you please how to get component instance in this approach?
>
> Thanks a lot!
>
> On Wed, Apr 27, 2011 at 7:30 PM, Greg Brown <gk...@verizon.net> wrote:
> > "宋体" is one Chinese font, i guess it might be too late to set font in the initialize method, but i can not figure out how to do this. Any suggestions?
>
> Yes, initialize() is too late. You need to set it in Application#startup().
>
>
Re: Calender display problem
Posted by Le Zhou <le...@gmail.com>.
Hi, Greg,
I'm not sure i understand your reply above right...
Do i have to change my app to "extends Application" instead of "extends
Window implements Bindable"
As most examples in the tutorial, if my app extends Window implements
Bindable, I start my app by the ScriptApplication class, and i can use the
get(bxml:id) method of the argument "Map<String, Object>" of the initialize
method to get instance of each component, and add Listner to it
i haven't use the "extends Application" approach yet, would you please how
to get component instance in this approach?
Thanks a lot!
On Wed, Apr 27, 2011 at 7:30 PM, Greg Brown <gk...@verizon.net> wrote:
> > "宋体" is one Chinese font, i guess it might be too late to set font in the
> initialize method, but i can not figure out how to do this. Any suggestions?
>
> Yes, initialize() is too late. You need to set it in Application#startup().
>
>
Re: Calender display problem
Posted by Greg Brown <gk...@verizon.net>.
> "宋体" is one Chinese font, i guess it might be too late to set font in the initialize method, but i can not figure out how to do this. Any suggestions?
Yes, initialize() is too late. You need to set it in Application#startup().
Re: Calender display problem
Posted by Le Zhou <le...@gmail.com>.
My App extends the Window class and implements the Bindable Interface, I
added the following line at the beginning of the initialize method, it
doesn't work.
Theme.getTheme().setFont(new Font("宋体", Font.PLAIN, 12));
"宋体" is one Chinese font, i guess it might be too late to set font in the
initialize method, but i can not figure out how to do this. Any suggestions?
On Tue, Apr 26, 2011 at 7:41 PM, Greg Brown <gk...@verizon.net> wrote:
> The default font (Verdana) does not include Chinese characters. You need to
> specify a Chinese-compatible font at application startup. The easiest way to
> do this is to call Theme.getTheme().setFont() before you load your UI.
> G
>
> On Apr 25, 2011, at 7:16 PM, Le Zhou wrote:
>
> Chinese
>
> On Mon, Apr 25, 2011 at 11:18 PM, Greg Brown <gk...@verizon.net> wrote:
>
>> What locale is your application running in?
>>
>> On Apr 25, 2011, at 10:55 AM, Le Zhou wrote:
>>
>> > Hi, everyone
>> >
>> > The Calender component has one kinda display problem on my windows XP
>> platform. Value of month and values of day of week are shown as sequences of
>> squares as follows:
>> >
>> > <calendar.png>
>> >
>> >
>> > JRE on my windows is of version 1.6.0_25.
>> >
>> > Can anyone tell me how to fix this problem? Thanks a lot!
>>
>>
>
>
Re: Calender display problem
Posted by Greg Brown <gk...@verizon.net>.
The default font (Verdana) does not include Chinese characters. You need to specify a Chinese-compatible font at application startup. The easiest way to do this is to call Theme.getTheme().setFont() before you load your UI.
G
On Apr 25, 2011, at 7:16 PM, Le Zhou wrote:
> Chinese
>
> On Mon, Apr 25, 2011 at 11:18 PM, Greg Brown <gk...@verizon.net> wrote:
> What locale is your application running in?
>
> On Apr 25, 2011, at 10:55 AM, Le Zhou wrote:
>
> > Hi, everyone
> >
> > The Calender component has one kinda display problem on my windows XP platform. Value of month and values of day of week are shown as sequences of squares as follows:
> >
> > <calendar.png>
> >
> >
> > JRE on my windows is of version 1.6.0_25.
> >
> > Can anyone tell me how to fix this problem? Thanks a lot!
>
>
Re: Calender display problem
Posted by Le Zhou <le...@gmail.com>.
Chinese
On Mon, Apr 25, 2011 at 11:18 PM, Greg Brown <gk...@verizon.net> wrote:
> What locale is your application running in?
>
> On Apr 25, 2011, at 10:55 AM, Le Zhou wrote:
>
> > Hi, everyone
> >
> > The Calender component has one kinda display problem on my windows XP
> platform. Value of month and values of day of week are shown as sequences of
> squares as follows:
> >
> > <calendar.png>
> >
> >
> > JRE on my windows is of version 1.6.0_25.
> >
> > Can anyone tell me how to fix this problem? Thanks a lot!
>
>
Re: Calender display problem
Posted by Greg Brown <gk...@verizon.net>.
What locale is your application running in?
On Apr 25, 2011, at 10:55 AM, Le Zhou wrote:
> Hi, everyone
>
> The Calender component has one kinda display problem on my windows XP platform. Value of month and values of day of week are shown as sequences of squares as follows:
>
> <calendar.png>
>
>
> JRE on my windows is of version 1.6.0_25.
>
> Can anyone tell me how to fix this problem? Thanks a lot!