×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Jun 2009
    Location
    Tel-Aviv Israel
    Posts
    410

    Multi-language fonts

    hey guys,

    I started to deal with fonts very early and got to realize that I cannot count on the system font of different phones to behave the same. therefore I have made my own font from a set of images. but here is the issue, when I set English letters I have a string for the chars "abc...XYZ01..9..." works fine for any English base language,
    but when I try to define Hebrew for example, Eclipse does not even allow me to type it into the editor, because the language is not set for the project, so I smell here a problem for the future implementation of my idea, since each language would require to have a string with its font to know which font image to paint, and since I must have the language added into the project, there is no sure way to know which texts may be loaded and which would throw an exception or crash the application. is there a way around this?
    Thanks,
    Adam Zehavi.

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

    Re: Multi-language fonts

    Hello,

    You can do this in two ways,

    1. You get the device Locale and then according to that you create the font for the application using the custom image.

    2. You can browse a main menu to the user to select the application's Locale irrespective to the device in built Locale.
    You can get the device Locale,using
    String locale = System.getProperty("microedition.locale");
    http://discussion.forum.nokia.com/fo...edition.locale
    http://wiki.forum.nokia.com/index.ph...text_resources
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Regular Contributor
    Join Date
    Jun 2009
    Location
    Tel-Aviv Israel
    Posts
    410

    Re: Multi-language fonts

    I guess what I'm asking is, if I have a file with 10 Strings with 10 different languages would loading them into the memory would throw an exception? I ask because Eclipse does not allow me even to write in the editor other languages but english...
    Thanks,
    Adam Zehavi.

  4. #4
    Regular Contributor
    Join Date
    Jun 2009
    Location
    Tel-Aviv Israel
    Posts
    410

    Re: Multi-language fonts

    well I can load them but still Eclipse shows me in debug mode other languages that has been loaded from a file, but does not allow to write in the editor any other language other then English, is that an Eclipse error?
    Thanks,
    Adam Zehavi.

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

    Re: Multi-language fonts

    In source code, I suggest you never use any non-ASCII characters. If you need other characters, escape them as '\uXXXX'. Write a Word or Excel macro to convert some strings for you. Or, store the text in an external file - here's the technique I've often used. For font definitions, I make these part of the font data.

    Graham.

  6. #6
    Regular Contributor
    Join Date
    Jun 2009
    Location
    Tel-Aviv Israel
    Posts
    410

    Re: Multi-language fonts

    I wrote an editor using Swing, and just save the Text writeUTF(text);
    should not have any problems with this implementation right?
    Thanks,
    Adam Zehavi.

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

    Re: Multi-language fonts

    That's exactly what I recommend!

Similar Threads

  1. Multi language
    By nimmyliji in forum [Archived] Flash Lite on Nokia Devices
    Replies: 6
    Last Post: 2010-07-05, 11:26
  2. Maemo Repositorys Down?
    By beaua in forum Nokia N9
    Replies: 29
    Last Post: 2010-05-30, 16:20
  3. Other language fonts
    By manikantan in forum [Archived] Flash Lite on Nokia Devices
    Replies: 2
    Last Post: 2008-10-14, 06:44
  4. indian language fonts
    By s_thambi_k in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2008-06-22, 15:35
  5. Asian Language (Japanese/Chinese) localization fonts
    By georgechen in forum Mobile Java General
    Replies: 1
    Last Post: 2006-05-24, 01:42

Posting Permissions

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