problem
When setting the *font* property of a Ti.UI.Label to *null* or *{}*, the font of the Label does not return to the default font which is used when no font property is defined. It instead is set to a font slightly smaller than the default font. This is best seen by running the test case below.
This is an issue for Alloy as it relies on the ability to "reset" Titanium proxy properties in order to remove/reset style classes at runtime. In its current state, this could potentially create unexpected visual results on iOS.
expected
When I set the the *font* property of a Ti.UI.Label to *null* or *{}*, the font of the Label should return to its default state. This is what occurs on Android and Mobileweb.
test case
app.js
var win = Ti.UI.createWindow({
backgroundColor: '#fff',
modal: false,
exitOnClose: true
});
var label = Ti.UI.createLabel({
text: 'just a test label'
});
// Clicking the label will show that on iOS a slightly smaller font is used when
// the label is re-rendered with font=null. All other platforms use the same default
// font.
label.addEventListener('click', function(e) {
label.font = null;
});
win.add(label);
win.open();
Issue reproduces Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.3.0.GA iOS SDK: 7.1 iOS iPhone Simulator: 7.1
iOS uses the default font-size of 17 these days, we used 14/15 in many places. This PR will align the defaults to the native defaults, so when you click, the label should not decrease. This will also fix number of potential other font-tickets. PR: https://github.com/appcelerator/titanium_mobile/pull/9182
Verified fix in SDK version: 6.2.0.v20170719160617. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/9182