Ui.loadResource(Rez.Fonts.xxx);

Hi,

I am trying to load a resource font created with BMFont tool. Was working perfectly until upgrade to SDK 2.x, the program stop at this line with the error
"
Failed invoking <symbol>
Invalid Value
in onLayout (source\slowView.mc:94)
Connection Finished
",
the line 94 being:
fontBigMinutes = Ui.loadResource(Rez.Fonts.Geneva65);

Any idea what is happening ?

Thanks,
  • I've got no idea now, but you might try checking that the font resource is being found...

    if (! (Rez.Fonts has :Geneva65)) {
    Sys.println("Rez.Fonts.Geneva65 didn't exist");
    Sys.exit();
    }

    fontBigMinutes = Ui.loadResource(Rez.Fonts.Geneva65);


    If the program outputs the error message, that implies that you either aren't compiling the resource file that contains that font definition, or you've renamed the font resource.

    Travis
  • For the ones who could run into this problem, here is the solution.
    I was building my watchface with my own 'makefile' instead of building it with Eclipse.
    I found that I was missing an important parameter in the build options which discarded the font resources in the final package (.prg file).
    So I analysed the command line from Eclipse and the option I was missing was: "-d round_watch_sim". Don't ask me why...
    But if I remove this option the package is some kbytes lighter than with the option and I guess those kbytes represent the font data...

    Happy coding...
  • Just a note, but "round_watch_sim" is the generic round watch, and doesn't indicate "all round watches".

    You may want to switch to specific targets, such as "fenix3_sim" and "fenixchronos_sim"

    (I picked these two as there are differences, in both the version of CIQ they run as well as memory available)