Project: titanium
Issue TIMOB-18407: Attributed Text: Ti.UI.ATTRIBUTE_FONT not working
ENVIRONMENT Mac OS X 10.9.5 Ti CLI: 3.5.0-dev Titanium SDK 3.6.0.v20150119054128, 3.5.0.GA Android 5.0, Genymotion emulator, Google Nexus 7 - 4.4.4 - API 19 - 800x1280 iOS 8.1, Xcode 6.1.1, iPhone 6+ simulator REPRODUCTION: Run the code below in the iOS simulator and Genymotion emulator using TiSDK 3.6.0. ACTUAL RESULTS: The label with the attributed string does not match the second label. See the 3.6.0 screenshots. EXPECTED RESULTS: Both labels should match. See the 3.5.0 screenshots. OTHER INFO: Using AttributedString with the iOS namespace works with 3.5.0.GA but has the same results with 3.6.0. Change Ti.UI.createAttributedString to Ti.UI.iOS.createAttributedString and Ti.UI.ATTRIBUTE_FONT to Ti.UI.iOS.ATTRIBUTE_FONT {code} var win = Ti.UI.createWindow({ backgroundColor: '#999', layout: 'vertical' }); var text = "Have you tried hyperloop yet?"; var attr = Ti.UI.createAttributedString({ text: text, attributes: [ { type: Ti.UI.ATTRIBUTE_FONT, value: { fontSize: 24, fontFamily: 'Helvetica Neue' }, range: [0, text.length] } ] }); var label = Ti.UI.createLabel({ attributedString: attr, top: 50 }); var label2 = Ti.UI.createLabel({ top: 10, font: { fontSize: 24, fontFamily: 'Helvetica Neue' }, text: text }); win.add(label); win.add(label2); win.open(); {code}
Story points: 3