[TIMOB-2767] Titanium.UI.XXX components with font-xxxx properties fail JSLint/crash
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2013-07-31T23:23:31.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Jean-Etienne LaVallee |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T03:28:59.000+0000 |
Updated | 2017-03-16T21:14:43.000+0000 |
Description
Just noticed this when I was attempting to make a zombie Ti.js file for my auto-completion hack in NetBeans using the api.json file for 1.5.1
A number of Ti.UI.XXXX components that have text metrics (button, label, etc.) now have properties like "font-family" and "font-size" in addition to the original "font" property. Problem is that the "-" in the property name is malformed Javascript and blows up both the JSLint pass during compilation (which only gives a warning) and then makes an app that crashes on the first instance of such.
Shouldn't these be JS friendly camel-cased, like fontFamily, fontWeight, fontStyle, etc.?
Thnx,
Etienne
Do we even support these properties? We should probably remove them in favor of
font
andfont.size
etc.The bug here is probably (?) that the documentation is wrong. Take a look at the documentation for label, for instance: http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.Label-object"> http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI....
It claims to have a property like "font-weight", but AFAIK it doesn't? The font weight is set by setting the font property like this:
I.e.
Not only does Label not seem to have the property font-weight, but when setting the font property it's fontWeight.
This can probably be closed.
We do not support "font-size", "font-family", etc via the JavaScript API. We do support these in .jss files, but jss support is undocumented.
Closing ticket as the issue won't fix.