×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    2

    Setting font style for Nokia E65

    Hi everybody,
    I am developing a j2me application.I am drawing a string on a canvas.
    I want the string to be bold.My paint method looks like this :-

    Code Snippet :-

    protected void paint(Graphics g) {

    width = getWidth();
    height = getHeight();
    g.setColor(0xffffff);
    g.fillRect(0, 0, width, height);
    g.setColor(0x000000);

    String s = "Test this one";
    g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD,Font.SIZE_SMALL));
    g.drawString(s, 2, 2, 0);
    }

    The problem i m facing is that when i run the above code in Nokia E65,it does not make the string bold whereas on other handsets it does show the required effect i.e the
    string is displayed in bold style.

    Please help me to resolve the problem.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Setting font style for Nokia E65

    MIDP allows you to specify what font you want... but there is no guarantee you will get it. For example, a Motorola V500 has only one font, and whatever face, style and size you specify, you will get the same font.

    A device might provide a different style, if you ask for a different face (for example FACE_PROPORTIONAL), or a different size. You can ask the Font what style it actually is.

    Code:
    myFont.isBold()
    If the device does not want to give you a bold font, then there is nothing you can do. (Other than to do what most game developers do, and draw your own font.)

  3. #3
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: Setting font style for Nokia E65

    Hey Guy's,
    The same issue I have faced...and was unable to do anything with it as far as the System fonts are concern..Then I move towards that the custom fonts..
    Then that issue was resolved..

    vipin_nambiar you can follow the same concept..if feasible...
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. Setting font and font size in CAknSettingItemList control?
    By zmiceruk in forum Symbian User Interface
    Replies: 4
    Last Post: 2009-09-22, 06:52
  2. Using the font from setting list in custom listbox
    By alav in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-11-05, 17:17
  3. [announce] full screen dot amtrix scroller
    By xchip in forum Symbian
    Replies: 7
    Last Post: 2006-06-08, 22:17
  4. Setting font in Series 60
    By hariprasadth in forum Symbian User Interface
    Replies: 3
    Last Post: 2005-11-10, 12:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×