Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hyphenationFactor doesn't work #63

Open
gh552 opened this issue Jul 17, 2020 · 0 comments
Open

hyphenationFactor doesn't work #63

gh552 opened this issue Jul 17, 2020 · 0 comments

Comments

@gh552
Copy link

gh552 commented Jul 17, 2020

NSMutableParagraphStyle hyphenationFactor doesn't work with NantesLabel

To Reproduce
Steps to reproduce the behavior:

  1. set hyphenationFactor to 1 - example:
    let label = NantesLabel (frame: .zero)
    label.delegate = self
    label.numberOfLines = 0
    let attrString = NSMutableAttributedString(string: longText)
    let style = NSMutableParagraphStyle ()
    style.hyphenationFactor = 1.0
    let fullRange = NSMakeRange(0, attrString.length)
    attrString.addAttributes([NSMutableAttributedString.Key.paragraphStyle : style], range: fullRange)
    label.attributedText = attrString
  2. the resulted label does not have hyphenation.
    If I set the label to UILabel, hyphenation works.

Expected behavior
The line brake for the long text is done with the hyphenation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant