Can't get custom fonts to work

Hi,

Going kinda nuts here trying to figure out why I can't get custom fonts to work.

I created a super minimal watch face example generated using the Eclipse standard watchface template (no settings) and then added the font from the "Analog" watch face included in the SDK sample folder. Code is available here: https://github.com/joekaczmarek/garmin-custom-font

Added a fonts.xml with the following contents:

<fonts>
    <font id="id_font_black_diamond" filename="blackdiamond.fnt" filter="0123456789" />
</fonts>

Error I get (both on the simulator and a physical Fenix5) is the following:

Failed invoking <symbol>
Invalid Value
  in WatchFace (Rez:23)
  in onLayout (/Users/asimilator/Projects/MONTEST/source/MONTESTView.mc:14)

Anyone know what I'm doing wrong here? Interestingly, I can run Analog in the sim and on my device with no problems.

  • Hye, 

    I followed this vidéo to use custom font, it works well

    https://youtu.be/PRQyA4BeqqE

  • Thanks, but no dice. His fonts.xml looks identical to mine.

    For what it's worth I get the same error message regardless of whether I try to use the font in a layout or by loading it manually (WatchUi.loadResource).

    // Load your resources here
        function onLayout(dc) {
            setLayout(Rez.Layouts.WatchFace(dc));
            var font = WatchUi.loadResource(Rez.Fonts.id_font_black_diamond);
        }

    Failed invoking <symbol>
    Invalid Value
      in onLayout (/Users/asimilator/Projects/MONTEST/source/MONTESTView.mc:15)

    Eclipse autocomplete will happily complete the font name, and if it's spelled incorrectly the compiler will kick out an error, which both implies to me that the compiler is actually finding my fonts.xml.

  • I downloaded your app from github and it's working fine.  I used both the 3.0.11 and 3.1.0 beta SDKs.  The only thing is that ":" is needed in the filter.

  • Hmm, must be something wrong with how my SDK is setup. I never could get monkeydo (or the Eclipse plugin) to run properly (it never actually copies the compiled prg to $TMPDIR/Garmin/Apps, so I've been manually copying it there before running monkeydo). That being said, Analog.prg works ...

    None of the tooling gives any sort of useful logging (not the sim, not monkeydo, and I can't figure out how to get "shell" to do anything useful) so I have no idea why it's not working. Maybe I'll try installing it on a Windows machine (tried both Linux and OS X).