Problems using custom fonts with resource-specific folders

Hello,

I'm working on a project watch face which uses only custom fonts.  As a result, it has become necessary to create resource-specific folders as the non-round devices do not have as much memory as the round ones so for these I need to have a smaller list of font sizes.  My folder list is as follows:-

Project
--  bin
--  resources
--  --  drawables
--  --  layouts
--  --  resources-rectangle
--  --  --  resource
--  --  --  --  fonts
--  --  --  --  resources.xml
--  --  resources-round
--  --  --  resource
--  --  --  --  fonts
--  --  --  --  resources.xml
--  --  resources-semiround
--  --  --  resource
--  --  --  --  fonts
--  --  --  --   resources.xml
--  --  settings
--  --  strings
--  --  resources-eng
--  source

The issue is that no matter what device I use, the same size fonts are displayed, so for smaller devices they look OK but for larger devices such as Fenix 6/6X or Venu the font is a lot smaller than I specified.  I've followed the Programmer's Guide on resource folders and I don't think there is anything missing.  Can someone advice please?

Thanks in advance.

  • Things like resources-rectangle need to be on the same level as resources, not under resources.

    Here's how it looks for one of my WFs:

    under reach of the resources* folders, I have a fonts folder, and under that, the font.xml and the fonts themselves.

  • Thank you very much.  However, I did previously have all the resources folders on the same level and I got compilation errors for all of them stating unable to find resource, although the result was the same (only one size font showing).  I'm away from my computer now, but I will put things back the way they were and post the actual error messages here. By having the inner resource folders I don't get those errors at all but still with the wrong font size.

    One other thing - I have 4 different font sizes for each device - tiny, small, large and huge. If I define a huge font for a small device as size 40 but define it as a small font for a larger device, would that cause a difference?

  • What I posted works in a number of my watch faces.  The path names in the xml file under each is relative to the location of the xml, so that's something to look at.

  • So I've put the folders as you suggested, here:-

    And here's the code:-

    Rectangle resources.xml
    <resources>
        <fonts>
            <font id="id_font_LetsGoDigital_15" filename="fonts/LetsGoDigital15.fnt"/>
            <font id="id_font_LetsGoDigital_20" filename="fonts/LetsGoDigital20.fnt"/>
            <font id="id_font_LetsGoDigital_25" filename="fonts/LetsGoDigital25.fnt"/>
            <font id="id_font_LetsGoDigital_30" filename="fonts/LetsGoDigital30.fnt"/>
            <font id="id_font_LetsGoDigital_35" filename="fonts/LetsGoDigital35.fnt"/>
            <font id="id_font_LetsGoDigital_40" filename="fonts/LetsGoDigital40.fnt" filter="0123456789:"/>
        </fonts>
    </resources>
    
    View.mc
    if (screenShape == System.SCREEN_SHAPE_RECTANGLE) {
    			tinyFont = WatchUi.loadResource(Rez.Fonts.id_font_LetsGoDigital_15);
    	        smallFont = WatchUi.loadResource(Rez.Fonts.id_font_LetsGoDigital_20);
    	        largeFont = WatchUi.loadResource(Rez.Fonts.id_font_LetsGoDigital_25);
    	        hugeFont = WatchUi.loadResource(Rez.Fonts.id_font_LetsGoDigital_40);
    } etc

    But I'm getting errors like these:-

    BUILD: ERROR: View.mc:136:  Undefined symbol "id_font_LetsGoDigital_15" detected.
    BUILD: ERROR: View.mc:137:  Undefined symbol "id_font_LetsGoDigital_20" detected.
    BUILD: ERROR: View.mc:138:  Undefined symbol "id_font_LetsGoDigital_25" detected.
    BUILD: ERROR: View.mc:139:  Undefined symbol "id_font_LetsGoDigital_40" detected.

    Even with the errors, it completes the compilation but I'm not getting the right font sizes - they are either bigger or smaller than I've set them.  I think it's just using one set of sizes for all devices.  I just don't know what else to do.