{ "id": "143202", "key": "TIMOB-18407", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "16593", "description": "Release 4.0.0", "name": "Release 4.0.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-01-21T17:26:26.000+0000", "created": "2015-01-19T22:54:12.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "16593", "description": "Release 4.0.0", "name": "Release 4.0.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "issuelinks": [], "assignee": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2015-01-21T20:44:25.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "ENVIRONMENT\r\nMac OS X 10.9.5\r\nTi CLI: 3.5.0-dev\r\nTitanium SDK 3.6.0.v20150119054128, 3.5.0.GA\r\nAndroid 5.0, Genymotion emulator, Google Nexus 7 - 4.4.4 - API 19 - 800x1280\r\niOS 8.1, Xcode 6.1.1, iPhone 6+ simulator\r\n\r\nREPRODUCTION:\r\nRun the code below in the iOS simulator and Genymotion emulator using TiSDK 3.6.0.\r\n\r\nACTUAL RESULTS:\r\nThe label with the attributed string does not match the second label. See the 3.6.0 screenshots.\r\n\r\nEXPECTED RESULTS: \r\nBoth labels should match. See the 3.5.0 screenshots.\r\n\r\nOTHER INFO:\r\nUsing AttributedString with the iOS namespace works with 3.5.0.GA but has the same results with 3.6.0.\r\n\r\nChange Ti.UI.createAttributedString to Ti.UI.iOS.createAttributedString and Ti.UI.ATTRIBUTE_FONT to Ti.UI.iOS.ATTRIBUTE_FONT\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#999',\r\n layout: 'vertical'\r\n});\r\n\r\nvar text = \"Have you tried hyperloop yet?\";\r\nvar attr = Ti.UI.createAttributedString({\r\n text: text,\r\n attributes: [\r\n {\r\n type: Ti.UI.ATTRIBUTE_FONT,\r\n value: { fontSize: 24, fontFamily: 'Helvetica Neue' },\r\n range: [0, text.length]\r\n }\r\n ]\r\n});\r\n\r\n\r\nvar label = Ti.UI.createLabel({\r\n attributedString: attr,\r\n top: 50\r\n});\r\n\r\nvar label2 = Ti.UI.createLabel({\r\n top: 10,\r\n font: { fontSize: 24, fontFamily: 'Helvetica Neue' },\r\n text: text\r\n});\r\n\r\nwin.add(label);\r\nwin.add(label2);\r\nwin.open();\r\n{code}", "attachment": [ { "id": "53717", "filename": "SDK3_5_0.png", "author": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-01-19T22:54:12.000+0000", "size": 123535, "mimeType": "image/png" }, { "id": "53718", "filename": "SDK3_6_0_Android.png", "author": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-01-19T22:54:12.000+0000", "size": 90996, "mimeType": "image/png" }, { "id": "53719", "filename": "SDK3_6_0_iOS.png", "author": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-01-19T22:54:13.000+0000", "size": 109241, "mimeType": "image/png" } ], "flagged": false, "summary": "Attributed Text: Ti.UI.ATTRIBUTE_FONT not working", "creator": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 309, "state": "closed", "name": "2015 Sprint 02 SDK", "startDate": "2015-01-17T01:00:16.697Z", "endDate": "2015-01-31T01:00:00.000Z", "completeDate": "2015-02-02T14:36:09.696Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "339780", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FYI", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-01-19T23:03:00.000+0000", "updated": "2015-01-19T23:03:00.000+0000" }, { "id": "339801", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~bhatfield], The way to use addAttribute is incorrect in the sample code.\r\nAttributedString requires to include \"font\" field in \"value\" when you use Ti.UI.ATTRIBUTE_FONT, as shown here:\r\n{code}\r\nvalue: { font:{fontSize: 24, fontFamily: 'Helvetica Neue' }}\r\n{code}\r\n\r\n\r\n\r\n", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-01-19T23:58:35.000+0000", "updated": "2015-01-19T23:58:35.000+0000" }, { "id": "339807", "author": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~cng], this changes the previous behavior with the iOS-specific namespace. Plus, you're wrapping the Font dictionary in another dictionary. I think it would be simpler just to pass the Font dictionary.", "updateAuthor": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-01-20T00:23:33.000+0000", "updated": "2015-01-20T00:23:33.000+0000" }, { "id": "339816", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~bhatfield], after some checking, you are right. the expected previous behavior is as you mentioned. \r\nI was a little misled because in the SDK, previous behavior wasn't working correctly at all. Will fix.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-01-20T00:58:25.000+0000", "updated": "2015-01-20T00:58:52.000+0000" }, { "id": "339957", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR Here: https://github.com/appcelerator/titanium_mobile/pull/6590", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-01-20T19:28:28.000+0000", "updated": "2015-01-20T19:28:28.000+0000" }, { "id": "340149", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Verified fix on:\r\n\r\nMac OSX 10.10.1\r\nAppcelerator Studio, build: 3.4.1.201410281743\r\nTitanium SDK build: 3.6.0.v20150121092531\r\nTitanium CLI, build: 3.4.1\r\nAlloy: 1.5.1\r\nXcode 6.1.1\r\niPhone 6 Plus (8.1), Nexus 5 (5.0)\r\n\r\nUsing the code provided built to device, both of the labels now display with the same attributed text.\r\n\r\nClosing ticket.", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2015-01-21T19:27:52.000+0000", "updated": "2015-01-21T19:30:23.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }