Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23367

Expose/support hyphenationFactor & hyphenationFrequency for Attributed Strings

    Details

    • Story Points:
      8
    • Sprint:
      2017 Sprint 14 SDK

      Description

      iOS and Android both support hyphenation in native land. There is no option to use this in a Titanium app. (afaik)
      It would be very convenient to have this functionality in Ti.UI.Label. Especially in our case for German apps.

      Implementing this in Swift is extremely easy:

      let paragraphStyle = NSMutableParagraphStyle()
      paragraphStyle.hyphenationFactor = 1.0
      		
      let attributedString = NSAttributedString(string: text, attributes: [NSParagraphStyleAttributeName:paragraphStyle])
      		
      label.attributedText = attributedString
      

      iOS, hyphenationFactor: https://developer.apple.com/library/ios/documentation/Cocoa/Reference/ApplicationKit/Classes/NSMutableParagraphStyle_Class/#//apple_ref/occ/instp/NSMutableParagraphStyle/hyphenationFactor

      Android, hyphenationFrequency:
      http://developer.android.com/reference/android/widget/TextView.html#attr_android:hyphenationFrequency

      Extra info:
      https://en.wikipedia.org/wiki/Hyphen

        Attachments

          Activity

            People

            • Assignee:
              vijaysingh Vijay Singh
              Reporter:
              gertjans Gertjan Smits
              Reviewer:
              Hans Knöchel
            • Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code