×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    What is the path for the default Font directory on a Nokia device?

    I need to install a font along with my app and was wondering where the system fonts are on a nokia device and if that directory changes for the various nokia devices.

    Kind regards

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,561

    Re: What is the path for the default Font directory on a Nokia device?

    The default system fonts (ROM, read-only) are in Z:\resource\Fonts.

    You can also put fonts in the same corresponding location in phone memory (the C-drive, which is writable NAND Flash).

    You need to be careful with installing/overriding system fonts, as it might (depending on the case) also affect not just your own application.

    I also once saved an interesting discussion thread on the old Symbian Ltd developer forums by hamishw. As they're no longer around (not sure if there's an archive online), I'll reproduce the text here, in case it is useful:

    When requesting a font you supply a requested font spec (which can include name, size, and other attributes including style). When returning a font it will fill in the actual font spec that it is returning (they won't always match exactly). A custom font that is loaded as part of an app is currently then available to everybody as a normal font.

    The font matcher does a number of things. First it checks the existing font cache for an exact match to everything in the requested font spec (name, size, attributes etc) - if we have already got this font, by name, either as a bitmap font or as a rasterized (TrueType) font, in the correct size and style, then it returns immediately with this font.

    If that didn't work then uses the full-strength font matcher. This gets "best match" to the requested spec from the font stores, based on a number of criteria:
    1. Font name (and failing that it will fall back through font family name)
    2. Best match on size of font
    3. how well all the other attributes match

    A correct match to the font name scores very highly, and will practically guarantee the return of that font. Size matching has the next greatest affect - such that a name-size match would almost guarantee a return of the font. This is where Sander is wrong - font name matters a lot. Attributes such as serif, poportional, bold etc. also count but much less so.

    There are two other relevant features of the font selection process. Note that the APIs to define these are partner-only:
    1. Default font.
    This allows the licencee to define, at any given point in (run)time, the name of a default font. If a font spec is requested that does not specify the font name then the default font name will be inserted before starting to look for a font.
    2. Font aliases.
    One or more aliases can be provided for a real font name - if one of these font aliases is uses then it will still match to the real font. The use case for this is to write applications specifying a standard font name then declare that font name on the device as an alias of the actual font you want used.

    Nokia built in apps often use the default font mechanism - i.e. they do not supply a desired font name. What you are seeing could occur if the device "default font" does not map to a real font on the device. In this case the weighting will be done purely on size and attributes (perhaps with some order of evaluation or of font discovery or alpha name order playing a part as well) and the results are a lot more pot luck.

    The same thing could happen if system aliases are mapped to real fonts which do not exist on the device.

    Its also possible there is another problem here. It may be that the order of evaluation means that if you specify an alias for font A that is the same as the real name of font B then the alias takes precedence - so you can mask a real font with an alias.


    The upshot of that discussion is that this is probably a Nokia defect, and as a developer you have limited scope to fix this.

    One approach may be to play around with the internal name of the custom font - alphabetic order of font names may affect things. A similar idea might be to play around with the name of the .GDR font file containing the custom font - alphabetic order might affect the order it is loaded versus the default device font files - which might affect the storage order of the fonts and thus their evaluation order.

  3. #3
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: What is the path for the default Font directory on a Nokia device?

    Quote Originally Posted by petrib View Post
    The default system fonts (ROM, read-only) are in Z:\resource\Fonts.

    You can also put fonts in the same corresponding location in phone memory (the C-drive, which is writable NAND Flash).

    You need to be careful with installing/overriding system fonts, as it might (depending on the case) also affect not just your own application.

    I also once saved an interesting discussion thread on the old Symbian Ltd developer forums by hamishw. As they're no longer around (not sure if there's an archive online), I'll reproduce the text here, in case it is useful:
    Hi Petrib

    Thanks for replying. I am not planning to overwrite the system fonts just add one or two that my app can use to display text.

    Kind regards

  4. #4
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: What is the path for the default Font directory on a Nokia device?

    Sorry another quick question i have been using / for my paths in the app but you have stated this Z:\resource\Fonts.

    does symbian recognise

    Z:\resource\Fonts

    and

    Z:/resource/Fonts

  5. #5
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,561

    Re: What is the path for the default Font directory on a Nokia device?

    Both probably work. Use a forward slash (some old Windows-ism reared its ugly head when I wrote my reply, even if I use a Mac ;-)

  6. #6
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: What is the path for the default Font directory on a Nokia device?

    Hi again

    I am trying to install the font when the app gets installed but it doesnt seem to be working. I have even tried to install the font to every possible location so that it may get picked up by my app.

    Code:
    font1.sources1 += fancy.ttf
    font1.path1 += E:/Resource/Fonts
    DEPLOYMENT += font1
    font2.sources += fancy.ttf
    font2.path += C:/Resource/Fonts
    DEPLOYMENT += font2
    font3.sources += fancy.ttf
    font3.path += Z:/Resource/Fonts
    DEPLOYMENT += font3

  7. #7
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    286

    Re: What is the path for the default Font directory on a Nokia device?

    Hi, application specific fonts are not supported in Qt at the moment. See http://bugreports.qt.nokia.com/browse/QTBUG-6611

  8. #8
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: What is the path for the default Font directory on a Nokia device?

    Quote Originally Posted by jakoskin View Post
    Hi, application specific fonts are not supported in Qt at the moment. See http://bugreports.qt.nokia.com/browse/QTBUG-6611
    Hi Jakoskin

    Thanks for your reply. I am actually using font in my css stylesheets.

    Code:
    #MainWindow {
    }
    QListWidget { 
    border: 3px solid rgb(77, 77, 70);
    border-radius: 8px;
    background: white;
    color: gray;
    }
    QLineEdit { 
    border: 3px solid rgb(77, 77, 70);
    border-radius: 8px;
    font: 8pt "FancyFont";
    background: white;
    color: gray;
    }
    It worked in the Nokia N8 simulators, I just copied the font i wanted to use into the simulator directory below:

    Code:
    C:\NokiaQtSDK\Simulator\Application\fonts
    I was hoping the principle would be the same on a real device?

  9. #9
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: What is the path for the default Font directory on a Nokia device?

    Right....i manually copied the ttf font into E:/Resource/Fonts and restarted device and it worked....i must have forgot to restart the device earlier in my attempts and caused myself a right headache. Thanks to everyone who replied.

  10. #10
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: What is the path for the default Font directory on a Nokia device?

    I am having issue now that i cannot resolve and could really do with some help. When i manually created the directory E:/resource/Fonts and put my ttf font in there after restarting the device the font was picked up by my app without any issues.

    I wouldnt expect a user to install an app and then have to start creating directories, copying font files and then restarting the device, personally i would expect the installation process to do all this.

    At present i am trying to copy the font to the correct location using the .pro file below:

    Code:
    font.sources += fancy.ttf
    font.path += E:/resource/Fonts
    DEPLOYMENT += font
    This doesnt work at all. Does anyone know how i can create the directory path "E:/resource/Fonts" and then copy a font file to that location. Even better if someone also knows how to restart the device after installation of the sis file.

    Any help would really be appriciated.

    Thanks
    Last edited by ginda1; 2010-12-14 at 10:30.

  11. #11
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    286

    Re: What is the path for the default Font directory on a Nokia device?

    Keywords are sources and path not sources1 and path1.

  12. #12
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: What is the path for the default Font directory on a Nokia device?

    Sorry jakoskin that was a typo, i have updated the below.

Similar Threads

  1. plzzz help to change the default directory
    By AshOoO in forum Symbian
    Replies: 3
    Last Post: 2010-11-19, 22:07
  2. Replies: 1
    Last Post: 2009-10-14, 10:01
  3. S60 default font size and adjusting font for N95
    By miohtama in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2009-07-10, 09:52
  4. Path of images directory in Nokia 7650
    By AzuManga in forum Symbian
    Replies: 1
    Last Post: 2005-06-14, 11:04
  5. Replies: 3
    Last Post: 2005-01-13, 02:53

Posting Permissions

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