×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    9

    Question Bitmap font creation procedure by LWUIT

    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 Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: Bitmap font creation procedure by LWUIT

    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
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  3. #3
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Bitmap font creation procedure by LWUIT

    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 10:52.

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,569

    Re: Bitmap font creation procedure by LWUIT


  5. #5
    Registered User
    Join Date
    Aug 2013
    Posts
    9

    Re: Bitmap font creation procedure by LWUIT

    I have used the above code and create the font in resource editor . In midlet, set the font to the text area but it does not work in s60 5th edition emulator. I am using LWUIT 1.5 and resource editor of the same version. Why font size of text area is not reduced?. Wasted 2 days for this problem and also creating more midlets and apply all the theme resources whatever I create. But didn't get result till now. Please help me.

  6. #6
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: Bitmap font creation procedure by LWUIT

    Quote Originally Posted by mani.seipl View Post
    I have used the above code and create the font in resource editor . In midlet, set the font to the text area but it does not work in s60 5th edition emulator. I am using LWUIT 1.5 and resource editor of the same version. Why font size of text area is not reduced?. Wasted 2 days for this problem and also creating more midlets and apply all the theme resources whatever I create. But didn't get result till now. Please help me.
    Are you able to use your custom font on Label and other displayable object and it's not working on the textArea ?
    Or you able to display your custom font but font is still big... you can select smaller size 6 on LWUIT resource editor while creating the font in that case.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

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
  •  
×