×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2009
    Location
    Gdansk, Poland
    Posts
    139

    Asha 501: DirectUtils.getFont() seems to return too large fonts

    Hello,

    The following code:

    Code:
    Font tmpFont = DirectUtils.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, 24 );
    System.out.println("font height="+tmpFont.getHeight());
    on all Symbian devices, as well as on Ashas <501, prints out

    font height=24

    as expected. On the Asha 501 however, it prints out

    font height=33

    Similarly if one requests other sizes, the height of the font gotten on Asha 501 is always about 50% too large.

    Has anyone seen this? How am I supposed to get a font of any size on the Asha 501 ?

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Asha 501: DirectUtils.getFont() seems to return too large fonts

    Can it happen that there is a system-level setting for using larger fonts? At least there is such setting on Symbian devices.
    (EDIT: actually I can not find such setting in http://download.fds-ncom.nokia.com/s...M_UG_en_SG.pdf)

  3. #3
    Registered User
    Join Date
    Mar 2009
    Location
    Gdansk, Poland
    Posts
    139

    Re: Asha 501: DirectUtils.getFont() seems to return too large fonts

    It doesn't look like the fonts are set to 50% larger. It looks like a genuine bug, because the following loop

    Code:
    Font f;
        
    for(int g=10;g<20;g++)
      {
      f = DirectUtils.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, g );
      System.out.println("requested "+g+" gotten "+f.getHeight());
      }
    prints out

    Code:
    requested 10 gotten 15
    requested 11 gotten 16
    requested 12 gotten 19
    requested 13 gotten 19
    requested 14 gotten 20
    requested 15 gotten 21
    requested 16 gotten 25
    requested 17 gotten 24
    requested 18 gotten 25
    requested 19 gotten 27
    Notice when we request font size 16, we get 25, but when we request 17 - we get 24!
    In light of this, I don't think this can be anything else but a genuine bug.
    Last edited by Utumno; 2013-07-31 at 15:34.

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

    Re: Asha 501: DirectUtils.getFont() seems to return too large fonts

    Hmmmm i havent checked this but to me it seems that they change the font system from pixel based to point based?
    Point based fonts are larger than pixel ones and they size depands on the device display.
    http://reeddesign.co.uk/test/points-pixels.html

  5. #5
    Registered User
    Join Date
    Jul 2013
    Posts
    1

    Re: Asha 501: DirectUtils.getFont() seems to return too large fonts

    I have the same issue.
    The documentation states:

    The height of the fonts created with DirectUtils.getFont includes extra space (leading) between lines of text. For example, the custom font created in the above code snippet is 50 pixels in height when both the leading and font are combined.
    But returned font doesn't include extra space.

    Code:
    Font font = DirectUtils.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, 23);
    System.out.println("font with height " + font.getHeight() + " and size " + font.getSize());
    prints out

    font with height 32 and size 23

Similar Threads

  1. [moved] JAR size too large for Asha devices
    By Utumno in forum Publishing to Nokia Store
    Replies: 8
    Last Post: 2013-07-25, 01:28
  2. Large Fonts & sounds
    By WinBase in forum Mobile Java General
    Replies: 1
    Last Post: 2008-01-14, 17:26
  3. Why are the fonts so large in NOKIA devices ?
    By altemir.soares in forum Mobile Java General
    Replies: 2
    Last Post: 2004-11-17, 14:07
  4. Why are the fonts so large in NOKIA devices ?
    By altemir.soares in forum Mobile Java General
    Replies: 0
    Last Post: 2004-04-26, 22:25
  5. Nokia 6600/large Fonts
    By malpart in forum General Development Questions
    Replies: 1
    Last Post: 2004-03-04, 08:55

Posting Permissions

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