Using Custom Fonts

Hey All,

Have done plenty o' searching and still haven't found a tutorial on how to use custom fonts on the watchface.

I have my font in the fonts directory and have added this to my resources.xml file:
<fonts>
<font id="id_konqa32_hd" filename="fonts/konqa32-hd.fnt" filter="0123456789"/>
</fonts>


At this point, I can't figure out what to do next. The API documentation doesn't really cover this as far as I can tell. Do I use the "font id" in place of on of the standard font number in the layout.xml file? Do I need to "load" the font somehow in onLayout()? I have tried several of these approaches by mimicking a few of the example templates, but none of them were successful.

So, how do I actually go about using a custom font?

Thanks.
  • I really appreciate the time you put on building the example, but my complain is not about if it is difficult or not to use custom fonts or to create them.

    My complain is about the documentation lacking important bits, like the one I mentioned. There is no place on the docs that say how to use a custom font on a layout file. Now I know that you can just reference it with @Fonts.Font_Id, but that is nothing that will just come to your mind magically. I know it thanks to this forum post, but I know that I will eventually forget and I think I should be able to check on the docs rather than on my old projects or old posts on the forum.

    Hope I make the point clear.

    Garmin developer community is awesome, you are all very helpful, but I think that Garmin the company should put some more effort into the resources they give to developers.

    Regards

  • I could not agree more. We just got started building watchfaces for Garmin, and we're having a difficult time ourselves navigating the documentation.

    Even adding a search feature to the site would help tonnes.

  • This really is not that difficult, and most of what you need to know is in this very thread, as well as the things Travis linked to.  There's also tons of code on gethub - see here: https://forums.garmin.com/developer/connect-iq/f/discussion/7961/overview-of-connect-iq-apps-accompanied-with-source-code

    I've found the hardest part of using custom fonts if finding a font I like and messing with sizes so things work.

    One thing to be careful of is if you use FORMAT_MEDIUM or FORMAT_LARGE with a moment, things like month and day of week with be localized based on the device settings so you will have issues displaying it if your font is only english characters.