• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Non-breaking hyphen in UILabel?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non-breaking hyphen in UILabel?


  • Subject: Re: Non-breaking hyphen in UILabel?
  • From: Kyle Sluder <email@hidden>
  • Date: Fri, 24 Jan 2014 11:47:51 -0800

On Fri, Jan 24, 2014, at 11:36 AM, Quincey Morris wrote:
> On Jan 24, 2014, at 09:58 , Kyle Sluder <email@hidden> wrote:
>
> > A quick test in TextEdit shows that AppKit does not render soft hyphens
> > as hyphens, but it will break on them.
>
> Actually, TextEdit is Doing It Wrong™.
>
> Soft (or discretionary) hyphens mark the points in a word where the word
> is allowed to break. A soft hyphen is invisible except when the word
> actually breaks there** — in which case it is typeset as a regular hyphen
> — and the word isn’t allowed to break anywhere but at a soft hyphen if it
> has any of them. This means, in particular, that if the soft hyphen is
> the first character of the word, the word won’t break at all (from
> auto-hyphenation, I mean).
>
> As others pointed out, a non-breaking hyphen is more or less exactly the opposite thing.

Yes, I think this confusion is entirely my own fault. But I still found
a bug in AppKit, so some good has come out of it. :)

To repeat my test, open a new TextEdit document and type the word
"test". Then paste in a soft hyphen. Notice how the soft hyphen is
correctly invisible. Then type the letters "ing" and a space. Copy and
paste that a whole bunch. Resize the window and watch as the text
correctly breaks at the soft hyphens, but fails to turn the hyphens
visible.

--Kyle Sluder

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Re: Non-breaking hyphen in UILabel? (From: Jens Alfke <email@hidden>)
 >Re: Non-breaking hyphen in UILabel? (From: Mike Abdullah <email@hidden>)
 >Re: Non-breaking hyphen in UILabel? (From: Kyle Sluder <email@hidden>)
 >Re: Non-breaking hyphen in UILabel? (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Non-breaking hyphen in UILabel?
  • Next by Date: Re: Non-breaking hyphen in UILabel?
  • Previous by thread: Re: Non-breaking hyphen in UILabel?
  • Next by thread: FlagsChanged while NSMenu is displayed
  • Index(es):
    • Date
    • Thread