×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    May 2008
    Posts
    52

    Exclamation how i can change font name, size,type

    hi
    how i can change font name, size,type and align in j2ME ?

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: how i can change font name, size,type

    Hi,

    It depends if you're using high-level (e.g.: Forms, Lists) or low-level (Canvas) UI components.

    In the first case, you have a setFont() method that will only set a "recommended" font for the specified component, but it'll be the actual JVM implementation to decide to use or not the Font you set.
    For Form Items you can also set some alignment properties via the setLayout() method, using the defined layout constants (you can find them in related JavaDocs).

    In the latter case, you have a total freedom of choice of Fonts, colors and aligns, but you'll have to handle all the painting operations "by hand", using low-level Graphics primitives.

    Pit

  3. #3
    Regular Contributor
    Join Date
    May 2008
    Posts
    52

    Re: how i can change font name, size,type

    thank you for your answer
    i want the socond case
    but
    iwant handel with ttf font
    for example tahoma font
    are you have example ?
    i want the socond case

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: how i can change font name, size,type

    So, if you want to use custom Fonts on Canvas, you should take a look at so-called Bitmap fonts (that is: fonts rendered with images).

    UI frameworks (like j2mepolish/) natively support them, but if you do not want to use one of them, you can find a lot of ready-to-use code examples around. Just some examples:

    http://www.gsmdev.com/projects/font4mobile/ (but it seems that page is no longer working)
    http://devlinslab.blogspot.com/2007/...onts-part.html

    Pit

Similar Threads

  1. Replies: 0
    Last Post: 2008-01-17, 06:22
  2. Change Font in CEikRichTextEditor
    By Holler in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-08-06, 18:11
  3. [announce] full screen dot amtrix scroller
    By xchip in forum Symbian
    Replies: 7
    Last Post: 2006-06-08, 22:17
  4. To change font name, size,type in j2ME
    By bvsbh in forum Mobile Java General
    Replies: 0
    Last Post: 2005-11-29, 07:36
  5. Change the default font for 7650
    By edmundkkchan in forum Symbian
    Replies: 1
    Last Post: 2002-09-24, 07:02

Posting Permissions

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