I'm trying to match the datafield label font in my DF (based on DataField class) For older devices (i.e fenix6) it used to work, because in simulator.json there are things like:
{
"layouts": [
{
"datafields": {
"datafields": [
{
"label": {
"font": "xtiny"
}
}
]
}
}
]
}
So I use FONT_XTINY.
(For the sake of this post I'm looking at the "ww" variants)
But on newer devices (i.e fr965) no it uses ttf:
{
"fonts": [
{
"fonts": [
{
"filename": "Roboto-Regular",
"name": "simExtNumber2",
"size": 5.4424,
"type": "ttf"
}
]
}
]
"layouts": [
{
"datafields": {
"datafields": [
{
"label": {
"font": "simExtNumber2"
}
}
]
}
}
]
}
However when I use RobotoRegular (BTW: IMHO there's a bug in simulator.json, and the filename probably should not contain the '-', but that's another issue) with size: 5.4424 then it is way to small:
var labelFont = Graphics.getVectorFont({:face => "RobotoRegular", :size => 5.4424});

(Note the datafield label is above "searching .")
Interestingly when I look here: https://developer.garmin.com/connect-iq/device-reference/fr965/ then there are different numbers from what is in simulator.json. i.e:
xtiny: simulator.json: 6.9542, device-reference: 37
Does anyone know how to "translate" the size in simulator.json to a number that when used in getVectorFont, will look like the real label?