How can I check if system has FONT_GLANCE_NUMBER?
Is enough to check monkey version > 3.1.7?
How can I check if system has FONT_GLANCE_NUMBER?
Is enough to check monkey version > 3.1.7?
You should be able to use Graphics has : FONT_GLANCE.
As a rule, I only use FONT_GLANCE* in a glance view, and only use FONT_GLANCE* in in a glance and not a regular view
it's a const so NO SYMBOL ERROR when using HAS.
Can you say that system loads glance fonts when glance view is visibled? It should be font like others.
I have used it for a while in view without any problem. Glance fonts size is between xtiny and tiny and it's useful.
hi, what about (WatchUi has :GlanceView) ?
It can be, now I'm using APP.AppBase has :getGlanceView.
I'd prefer something direct though
But (GRA has :FONT_GLANCE) runs...
strange that it runs even for devices 2.4 (e.g. fr735xt) on sim.
doc is not actual...
https://developer.garmin.com/connect-iq/reference-guides/devices-reference/#forerunner%C2%AE735xt
says that fr735xt has only FONT_XXX but it's 2.4 device so should have also FONT_SYSTEM_XXX
But (GRA has :FONT_GLANCE) runs...
strange that it runs even for devices 2.4 (e.g. fr735xt) on sim.
I think it runs because the SDK knows about that symbol, even if the device itself doesn't. If you could only use "has" for symbols that are already known to the device, then "has" would be pretty much useless.
A symbol is just a number under the covers afaict (*), so there's no issue with needing "FONT_GLANCE" to somehow be "defined" on the device before using it. The only issue is actually trying to resolve that symbol against a class/object when it doesn't exist in that context.
i.e. on old devices:
- Graphics has :FONT_GLANCE should work (but evaluate to false)
- Graphics.FONT_GLANCE should crash
(*) Looking at *.api.debug.xml in the devices folder:
<symbolTable>
...
<entry field="true" id="8391464" symbol="FONT_GLANCE"/>
I've looked into it... But it means it's a member or system runs in another way (now i can't see const in memory after optimization). We will see it in ERA
FontGlance = GRA has :FONT_GLANCE ? GRA.FONT_GLANCE : GRA.FONT_SYSTEM_XTINY;
Yeah I'm just saying I don't think a symbol (like FONT_GLANCE) itself has to be "looked up" anywhere because it's seems like it's just a unique number which is likely substituted for the symbol itself at compile time.
It seems that it's only when you *use* a symbol (in the context of a resolving a class/object method/variable, looking something up in a dictionary) etc. that an actual lookup occurs.
I could be wrong, but if I bet if you looked up the bytecode for that line of code you posted, you'd see 8391464 a couple of times.
Regardless of how it's implemented, it's pretty clear that symbols can't be required to be "known" to the device beforehand, otherwise "has" could never work.
on f6 runs well...