I have previously generated and used a custom font on my Watchface ("Concise"). I am now trying to generate a Data Field also with a custom font for a Speedometer. I cannot seem to get the font to display. I am getting no errors but also no text on either the simulator or the actual device. I am using the same font that works for Concise. I even tried creating a new Watch Face and copying the entire code over from Concise and it still does not work! Clearly something has changed that I am missing but the documentation is old and still refers to a Resources.xml instead of a fonts.xml file.
Here is the contents of my fonts.xml file...
<fonts>
<font id="SpeedoFont" filename="Rationale_Modified.fnt" filter="0123456789" />
</fonts>
The "Rationale_Modified.fnt" file is in the /resources/fonts/ folder of the project. As is the font.xml. The font file is a good file as it works for my Concise Watch Face.
Here is the entire code of my test Data Field which I had expect would display "88" is Rationale Modified font...
using Toybox.WatchUi as Ui;
using Toybox.Graphics as Gfx;
class CustFontView extends Ui.DataField {
function initialize() {
DataField.initialize();
}
function onLayout(dc) {
}
function compute(info) {
}
function onUpdate(dc) {
var SFont = Ui.loadResource(Rez.Fonts.SpeedoFont);
dc.setColor( Gfx.COLOR_RED, Gfx.COLOR_TRANSPARENT );
dc.drawText( 2, 2, SFont , "88", Gfx.TEXT_JUSTIFY_CENTER );
}
}
What am I missing?