{ "id": "160184", "key": "TIMOB-23367", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2018-05-02T08:56:15.000+0000", "created": "2016-05-11T10:56:27.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "attributedstring", "hyphenation", "label", "text" ], "versions": [], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-06T17:41:08.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": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "iOS and Android both support hyphenation in native land. There is no option to use this in a Titanium app. (afaik)\r\nIt would be very convenient to have this functionality in Ti.UI.Label. Especially in our case for German apps.\r\n\r\nImplementing this in Swift is extremely easy:\r\n{code:swift}\r\nlet paragraphStyle = NSMutableParagraphStyle()\r\nparagraphStyle.hyphenationFactor = 1.0\r\n\t\t\r\nlet attributedString = NSAttributedString(string: text, attributes: [NSParagraphStyleAttributeName:paragraphStyle])\r\n\t\t\r\nlabel.attributedText = attributedString\r\n{code}\r\n\r\n*iOS*, hyphenationFactor: https://developer.apple.com/library/ios/documentation/Cocoa/Reference/ApplicationKit/Classes/NSMutableParagraphStyle_Class/#//apple_ref/occ/instp/NSMutableParagraphStyle/hyphenationFactor\r\n\r\n*Android*, hyphenationFrequency:\r\nhttp://developer.android.com/reference/android/widget/TextView.html#attr_android:hyphenationFrequency\r\n\r\n*Extra info:*\r\nhttps://en.wikipedia.org/wiki/Hyphen", "attachment": [], "flagged": false, "summary": "Expose/support hyphenationFactor & hyphenationFrequency for Attributed Strings", "creator": { "name": "gertjans", "key": "gertjans", "displayName": "Gertjan Smits", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "gertjans", "key": "gertjans", "displayName": "Gertjan Smits", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 920, "state": "closed", "name": "2017 Sprint 14 SDK", "startDate": "2017-07-02T16:29:41.455Z", "endDate": "2017-07-16T16:29:00.000Z", "completeDate": "2017-07-17T14:39:47.328Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "385404", "author": { "name": "gertjans", "key": "gertjans", "displayName": "Gertjan Smits", "active": true, "timeZone": "Europe/Berlin" }, "body": "For Android it probably needs to be implemented in combination with *android:breakStrategy*. ", "updateAuthor": { "name": "gertjans", "key": "gertjans", "displayName": "Gertjan Smits", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-05-11T15:24:39.000+0000", "updated": "2016-05-11T15:24:39.000+0000" }, { "id": "385501", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nThanks for creating the ticket. Our engineering team will look into it. This need to be cleared by our selection committee. Please understand that the processes is time-consuming and lots of variables in play. We will let you know if and when we will be including this feature in our platform.\r\n\r\nRegards", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-05-12T05:31:09.000+0000", "updated": "2016-05-12T05:31:09.000+0000" }, { "id": "389567", "author": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "updateAuthor": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "created": "2016-06-30T10:05:08.000+0000", "updated": "2016-06-30T10:05:08.000+0000" }, { "id": "400250", "author": { "name": "gertjans", "key": "gertjans", "displayName": "Gertjan Smits", "active": true, "timeZone": "Europe/Berlin" }, "body": "Any updates on this? Client now really wants it...", "updateAuthor": { "name": "gertjans", "key": "gertjans", "displayName": "Gertjan Smits", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-11-02T12:28:05.000+0000", "updated": "2016-11-02T12:28:05.000+0000" }, { "id": "420669", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/9100\r\n\r\n\r\n{code:java}\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor: '#ddd',\r\n });\r\n\r\n win.open();\r\n\r\n var text = 'Bacon ipsum dolor Appcelerator Titanium rocks! sit amet fatback leberkas salami sausage tongue strip steak.';\r\n var paragraphStyle = Titanium.UI.createParagraphStyle({\r\n attributes:[\r\n {\r\n type:Titanium.UI.PARAGRAPH_ATTRIBUTE_HYPHENATION_FACTOTR,\r\n value:0.5\r\n },\r\n {\r\n type:Titanium.UI.PARAGRAPH_ATTRIBUTE_LINE_SPACING,\r\n value:20\r\n },\r\n {\r\n type:Titanium.UI.PARAGRAPH_ATTRIBUTE_FIRST_LINE_HEAD_INDENT,\r\n value:20\r\n }\r\n ]\r\n });\r\n\r\n var attr = Titanium.UI.createAttributedString({\r\n text: text,\r\n attributes: [\r\n // Paragraph Style \r\n {\r\n type: Titanium.UI.ATTRIBUTE_PARAGRAPH_STYLE,\r\n value: paragraphStyle,\r\n range: [0, text.length]\r\n },\r\n // Sets a background color\r\n {\r\n type: Titanium.UI.ATTRIBUTE_BACKGROUND_COLOR,\r\n value: \"red\",\r\n range: [text.indexOf('Appcelerator'), ('Appcelerator').length]\r\n },\r\n ]\r\n });\r\n\r\n var label = Titanium.UI.createLabel({\r\n left: 20,\r\n right: 20,\r\n height: Titanium.UI.SIZE,\r\n attributedString: attr\r\n });\r\n win.add(label);\r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-31T09:40:40.000+0000", "updated": "2017-05-31T09:40:40.000+0000" }, { "id": "437277", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Solved as part of TIMOB-24080.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-05-02T08:56:15.000+0000", "updated": "2018-05-02T08:56:15.000+0000" }, { "id": "439991", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as a duplicate. If this is in error, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:41:08.000+0000", "updated": "2018-08-06T17:41:08.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }