Hi,
I am using relative layouts and text-areas together with custom fonts in my watch face. It works just fine in the simulator but when running on the device I get an unhandled exception.
When I use my custom font in a <label> everything works fine, but when I try to use the custom font in a <text-area> I get this:
Error: Unhandled Exception
Time: 2023-01-16T13:40:13Z
Part-Number: 006-B2697-00
Firmware-Version: '25.00'
Language-Code: eng
ConnectIQ-Version: 4.1.7
Filename: MYFACE
Appname: myFace
Stack:
- pc: 0x30003e51
- pc: 0x30003a69
- pc: 0x100004c2
File: Rez.mc
Line: 24
Function: WatchFace
- pc: 0x10000140
File: 'C:\Users\fredrik\Garmin-projects\myFace\myFace\source\myFaceView.mc'
Line: 27
Function: onLayout
The custom font is made using BMFont, and works fine when I use it in a <label>.
This works:
<layout id="WatchFace">
<label id="custom" text="()" x="center" y="75%" font="@Fonts.Roboto64" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_CENTER" />
</layout>
But when I use the same custom font in a <text-area> I get the exception on the device (simulator works fine)
This does not work:
<layout id="WatchFace">
<text-area id="custom" text="()" x="center" y="65%" width="100%" height="100%" font="@Fonts.Roboto64" color="Graphics.COLOR_WHITE" />
</layout>
I also tried this (does not work):
<layout id="WatchFace">
<text-area id="custom" x="center" y="5%" width="100%" height="35%" justification="Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER" color="Graphics.COLOR_WHITE">
<fonts>
<font>@Fonts.Roboto64</font>
<font>@Fonts.Roboto52</font>
</fonts>
</text-area>
</layout>
The reason I'm using text-areas is that I want to create relative layouts that can use different font sizes based on screen size. It looks like a very neat way to handle multiple screen sizes.
Am I doing something wrong here?
I am side loading the watch face to the device, if that matters.
best regards
Fredrik