Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User sreeNarayana's Avatar
    Join Date
    Sep 2011
    Posts
    9
    hi,

    I am new to LWUIT. Please help me to create Telugu (Gautami) Bitmap font. At least tell me general procedure to create Bitmap with LWUIT. I found that It can be created by using Resource Editor. I downloaded Lwuit 1.5. I have tried many options on font tab to create Bitmap. In my system I already have Gautami font also. It is displaying in Font family selection box. When I save the file , just it creates Resource file(.res). What is the next step?

  2. #2
    Nokia Developer Moderator r2j7's Avatar
    Join Date
    Aug 2007
    Posts
    1,595
    Hello sreeNarayana,

    in case there is no response from the experts on this forum you might want to try asking about the issue on LWUIT's discussion forums: http://www.java.net/forums/mobile-embedded/lwuit

    Regards,
    r2j7

  3. #3
    Nokia Developer Expert skalogir's Avatar
    Join Date
    Aug 2011
    Posts
    547
    Hi sreeNarayana,

    Assuming that you created a .res file with Resource Editor, you need to set the font of the style of a component (such as a Label) to your custom font. Here is a sample code:
    Code:
    import com.sun.lwuit.Display;
    import com.sun.lwuit.Font;
    import com.sun.lwuit.Form;
    import com.sun.lwuit.Label;
    import com.sun.lwuit.layouts.BorderLayout;
    import com.sun.lwuit.plaf.Style;
    import com.sun.lwuit.util.Resources;
    public class LWUITfonts extends javax.microedition.midlet.MIDlet 
    {
    	public void startApp() 
    	{
    		Resources r = null;
    		Display.init(this);
    		try 
    		{
    			//Open your resource font
    			r = Resources.open("/myfont.res");
    			//get the Font object. Name should be the same as the one defined in Resource Editor
    			Font myfont=r.getFont("NameGivenInResourceEditor");
    			
    			Form f = new Form();
    			Label mylabel=new Label("Hello");
    			//Set the style of this component to your custom style
    			mylabel.getStyle().setFont(myfont);
    			
    		        
    			f.setTitle("Hello World");
    			f.setLayout(new BorderLayout());
    			f.addComponent("Center", mylabel);
    			f.show();
    		} catch (java.io.IOException e) {}
    
    	}
    	public void pauseApp() {}
    	public void destroyApp(boolean unconditional) {}
    }
    Make sure that the .res file is located in the resource folder of your working project.
    Last edited by skalogir; 2011-11-15 at 09:52.

  4. #4

Similar Threads

  1. LWUIT : arabic font problem
    By mahdi68 in forum Mobile Java General
    Replies: 2
    Last Post: 2011-08-08, 12:22
  2. use *.bmf bitmap font on LWUIt ?
    By mahdi68 in forum Mobile Java General
    Replies: 0
    Last Post: 2010-10-08, 16:28
  3. Gujaratri font using LWUIT
    By pkshekhda.123 in forum Mobile Java General
    Replies: 4
    Last Post: 2010-08-12, 12:10
  4. LWUIT Labels Font size problem
    By superchacho in forum Mobile Java General
    Replies: 4
    Last Post: 2010-06-16, 09:00
  5. Font and Bitmap Server
    By soumyavrao in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2002-06-11, 10:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved