×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    6

    Regional font in J2ME Lwuit

    Hello Experts.

    Am developing a j2me-lwuit app in which i need to show some information in Indian Regional langauges such as (Gujrati, Marathi, Telugu).

    My app works find for some of Nokia S40 devices.
    but on some mobiles it shows the square blocks.

    I have tried below thing which is not working for me.
    1) Added regionalFont.TTF file in Lwuit theme and applied it to components like Label, Textarea.

    I have used UTF-8 encoding which is correct I guess.

    Please guide me on this.

    Thanks
    Nilesh

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    678

    Re: Regional font in J2ME Lwuit

    1. are the same phone models show you the text and other dont show you the text?
    2. are they different phones models that you see the text on some and dont see on other?
    3. do the phone have that indian language installed in them? (i.e. can you change the phone UI to that language?)
    4. in LWUIT are you using standard fonts or bitmap fonts? (if your using bitmap then switch to normal/legacy fonts)
    5. lwuit j2me version doesnt support TTF fonts so it shouldnt work for you either way

  3. #3
    Registered User
    Join Date
    Nov 2012
    Posts
    6

    Re: Regional font in J2ME Lwuit

    hello shai


    i can see text in mobile devices which have that language installed in it that is i can change UI language to that particular language.
    i am not able to see text in those devices which does not have regional font installed in it .
    Im trying to achieve something like newshunt app which support all Indian regional language even if that particular language is not installed in device.

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    678

    Re: Regional font in J2ME Lwuit

    Well, that was pretty much the answer as to why you cant see the text on some fonts (because they dont have that language charset installed and your using the native fonts)
    i dont know newshunt but i can tell you that if you want to be phone characters indapendent you could try bitmap font since your working with lwuit you have build-in support for it (look in the resource editor under the fonts tab), you will have to set ALL the characters of EVERY language you wish to support, be aware this can take up alot of memory.

  5. #5
    Registered User
    Join Date
    May 2013
    Posts
    2

    Re: Regional font in J2ME Lwuit

    Thanks shai that was helpful could you guide me on creating indian language bitmap font?
    i know how to embed in resource editor and define charset for it just need help in creating bitmap font.

  6. #6
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    678

    Re: Regional font in J2ME Lwuit

    the lwuit resource editor creates the bitmap font for you, all you have to do is define it.
    go to the them your using and in the theme tabs click on fonts
    then click on + to add new font and in the combobox select bitmap font and in the characterset below put ALL the characters you need your font to support.
    and thats it you can now use that font by its name anywhere you want.

  7. #7
    Registered User
    Join Date
    May 2013
    Posts
    2

    Re: Regional font in J2ME Lwuit

    i did what u said but i am getting blank instead of characters when not applied UTF-8 encoding to text and when applied UTF-8 encoding the simulator gets hanged.
    do i need to apply encoding to text or not? and why it is showing blank any idea???

  8. #8
    Registered User
    Join Date
    Mar 2013
    Location
    Nasik, India
    Posts
    21

    Re: Regional font in J2ME Lwuit

    hello shai

    I have tried the same thing as you suggested.
    It is working up to some extent.
    However am facing below issue.

    To use Indian language in j2me app we need to provide charset in lwuit theme creator.
    But Indian langualge we need to provide each charater 12 times (constants & vowels combination)
    its not simply as English

    e.g. Gujrati

    ( ગ ગા ગિ ગી ગુ ગૂ ગે ગૈ ગો ગૌ ગં ગઃ which is equivalent to g, ga, gi, gee,.........)

    However my problem is that am not able to define multiple charset for single CONSTANT. (i.e. we cant define multiple variants of char 'G' in gujrati)
    So am not able to get the oupput text as expceted. it fails every-time while combining CONSTANT & VOWEL.

    Please suggest me on this and let me know if anything is not c

    Thanks
    Vishal.

  9. #9
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    678

    Re: Regional font in J2ME Lwuit

    Hey,
    I'm not an expert on Indial language so forgive me if i say something stupid.
    Is each one of the ગ ગા ગિ ગી ગુ ગૂ ગે ગૈ ગો ગૌ ગં ગ a unicode character? i.e. it has a different value in the general unicode table?
    if so i dont see any reason for just adding those characters to the entire characters string you need to define the bitmap font.

  10. #10
    Registered User
    Join Date
    Nov 2012
    Posts
    6

    Re: Regional font in J2ME Lwuit

    hey shai,

    let's take a example -
    character ગ is consonant and it has unicode value - 0A97(hex)
    character ા is vowel and it has unicode value - 0ABE(hex)
    to make character ગા you have to mix above mentioned character i.e ગ+ ા = ગા.(in indian language we must write ગા and not ગ ા)

    now problem is that while text rendering on device, mixing two character should look like ગા but it is looking like ગ ા.

    how do i make it look like ગા and not ગ ા.
    Last edited by nileshb; 2013-08-22 at 13:49.

  11. #11
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,555

    Re: Regional font in J2ME Lwuit

    That won't be easy/possible with fixed-width bitmap fonts, if the drawing mechanism is not intelligent enough so that you can tell it language-specific rendering requirements (there are also languaes where the glyph changes shape depending on what other glyphs are next to it, before or after, etc.).

    So, you need to write a smart, language-aware font drawing/rendering mechanism yourself, or only support the language on environments/devices where the platform has such support built-in.

  12. #12
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    678

    Re: Regional font in J2ME Lwuit

    does ગા also have a unicode value or not?

  13. #13
    Registered User
    Join Date
    Nov 2012
    Posts
    6

    Re: Regional font in J2ME Lwuit

    no shai it does not have unicode value it is a combination of a consonant and a vowel.
    we are mixing two character two make a word.

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

    Re: Regional font in J2ME Lwuit

    Quote Originally Posted by nileshb View Post
    no shai it does not have unicode value it is a combination of a consonant and a vowel.
    we are mixing two character two make a word.
    better to add this as a new character in your bitmap font strip and use it to render - instead of trying it as combination of consonant & vowel.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  15. #15
    Registered User
    Join Date
    Nov 2012
    Posts
    6

    Re: Regional font in J2ME Lwuit

    hi amit,

    actually we are not using bitmap font strip we have embedded .ttf file in resource editor of lwuit and have defined character set in the box provided ,
    lwuit resource editor automatically convert .ttf font to bitmap font internally as shai mentioned,

    if you want to be phone characters indapendent you could try bitmap font since your working with lwuit you have build-in support for it (look in the resource editor under the fonts tab), you will have to set ALL the characters of EVERY language you wish to support,

Similar Threads

  1. How to append LWUIT List screen to a LWUIT Form in j2me?
    By pavanragi in forum Mobile Java General
    Replies: 1
    Last Post: 2012-08-06, 07:01
  2. Hindi font display through LWUIT
    By sreeNarayana in forum Mobile Java General
    Replies: 4
    Last Post: 2011-12-20, 15:00
  3. use *.bmf bitmap font on LWUIt ?
    By mahdi68 in forum Mobile Java General
    Replies: 0
    Last Post: 2010-10-08, 16:28
  4. Gujaratri font using LWUIT
    By pkshekhda.123 in forum Mobile Java General
    Replies: 4
    Last Post: 2010-08-12, 12:10

Posting Permissions

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