i have created custom font "font.res" file using resource.jar file in lwuit,now i want to apply this Custom font to my Textarea Component,how to apply custom font any sample code ?
Asked
Active
Viewed 110 times
1 Answers
2
If you want to add into a text area,
ta.getUnselectedStyle().setFont(Font.getBitmapFont("fontname"));
fontname- the name you gave to font in res file
If not you can do it by,
in resource editor, open theme, double click the component you want to set the font and select font tab,
untick "derive font", tick "new font" and choose your font,
save res file and add it into your j2me project
-
should we need to generate whole project using resource editor?in my case,i just have created customfont using ResourceEditor jar file,that i want apply to Component in my project?can i able to apply without generating the wholeproject using Resource Editor? – String Aug 13 '12 at 06:10
-
not the whole project, u have to create the font as you wish and the theme, if you are using more than one font it's better to use your component with this ta.getUnselectedStyle().setFont(Font.getBitmapFont("fontname")); – wathmal Aug 15 '12 at 17:52