×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    2

    svg tiny fonts with j2me

    Hi,

    I'd like to calculate the string width and character height corresponding to a particular svg font for different font sizes.
    I'm new to svg tiny, and want to use it in my j2me application.

    Thanks

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

    Thumbs up Re: svg tiny fonts with j2me

    Hi,
    Is there any special requirement for the same...svg
    Another thing is that you can easily calculate that height and width of the FONT..whether it is SVG tiny or png..

    I have used png for the fonts and I will do it like this..

    CHARACTOR_WIDTH = WIDTH_OF_FONT_IMAGE/NO_ characters
    CHARACTOR_HEIGHT = FONTIMAGE.getHeight()--in case you your font strip contains all the characters in one row..


    else CHARACTOR_HEIGHT = FONT_IMAGE_HEIGHT/NO_OF_ROWS,

    Hope this makes sense.
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    2

    Re: svg tiny fonts with j2me

    Thanks for replying...
    I'm using svg tiny and now able to get the height and width.
    Is it possible to use underlined text by using svg tiny fonts, or i'll have to load different svg files for each font style (eg, bold, italics, underlined)
    Is there any way by which i can use system fonts for svg and i'll not have to load any svg font file.

    Thanks in advance.

    Quote Originally Posted by raj_J2ME View Post
    Hi,
    Is there any special requirement for the same...svg
    Another thing is that you can easily calculate that height and width of the FONT..whether it is SVG tiny or png..

    I have used png for the fonts and I will do it like this..

    CHARACTOR_WIDTH = WIDTH_OF_FONT_IMAGE/NO_ characters
    CHARACTOR_HEIGHT = FONTIMAGE.getHeight()--in case you your font strip contains all the characters in one row..


    else CHARACTOR_HEIGHT = FONT_IMAGE_HEIGHT/NO_OF_ROWS,

    Hope this makes sense.
    Thanks,

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

    Thumbs up Re: svg tiny fonts with j2me

    Hi,
    I guess for the images(Custom )Font you have to take the images for the different fonts styles and so on...
    for using system font it can be done..
    for the system fonts read it out..
    http://www.java-tips.org/java-me-tip...n-java-me.html

    Thanks,
    Last edited by raj_J2ME; 2008-11-17 at 07:21.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Registered User
    Join Date
    Jan 2004
    Location
    India
    Posts
    27

    Re: svg tiny fonts with j2me

    Hi Raj,
    I have been using PNG file for fonts for a long time. I have found your calculation (for finding the width of the character) to be working fine only when the characters in the font are balanced (monotype). If the characters are not balanced it is difficult to calculate the width of the character - for example : the width of the letters 'i' and 'l' are smaller than the rest of the characters. I hope you understood what I meant.

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

    Thumbs up Re: svg tiny fonts with j2me

    Hi,
    Well that truth..
    Chars like . M and i are of the different width...
    DO one thing put the chars in the mid of the strip..and take the width for each char of the maximum chars width..

    That will work,
    By the way what is the issue you are facing in the logic..
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. J2ME or C++ for VoIP on Mobile
    By sandeepkumar03 in forum VoIP
    Replies: 4
    Last Post: 2009-02-02, 10:28
  2. FONTS IN J2ME
    By pablovara in forum Mobile Java General
    Replies: 4
    Last Post: 2008-11-26, 06:58
  3. ANN: TinyLine SVG Player and SDK 1.8 released
    By girow in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2004-11-15, 07:17
  4. TinyLine SVG Toolkit version 1.5 is released.
    By girow in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2003-09-22, 18:08
  5. TinyLine SVG Toolkit version 1.5 is released.
    By girow in forum Mobile Java General
    Replies: 0
    Last Post: 2003-09-22, 18:07

Posting Permissions

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