• 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: How do I set a NSTextView's font in Interface Builder?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I set a NSTextView's font in Interface Builder?


  • Subject: Re: How do I set a NSTextView's font in Interface Builder?
  • From: Keary Suska <email@hidden>
  • Date: Fri, 24 Mar 2017 12:28:49 -0600

> On Mar 24, 2017, at 10:33 AM, Jens Alfke <email@hidden> wrote:
>
>
>> On Mar 23, 2017, at 6:35 PM, Daryle Walker <email@hidden> wrote:
>>
>> I have the NSTextView selected in its storyboard scene. And I have the Attributes Inspector active. The entry for the font is empty. Clicking the squared-T gives a pop-up with a “Custom” font and changing it to one of the fixed selections (User, fixed) doesn’t do any actual change.
>
> This is a longstanding bug, or maybe it’s an API issue. The problem is that the view’s text is empty, and an empty NSAttributedString can’t have any attributes because the attributes are associated with characters.
>
> IIRC you can fix this by adding some placeholder text, even a single space, in the view, then replacing it at runtime.

I don’t believe that is actually true. Attributes *can* apply to an empty range. Alternatively, or additionally, I believe if you call setTypingAttributes: on an empty text view that any new types text will use the specified attributes.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

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


  • Follow-Ups:
    • Re: How do I set a NSTextView's font in Interface Builder?
      • From: Daryle Walker <email@hidden>
    • Re: How do I set a NSTextView's font in Interface Builder?
      • From: Jens Alfke <email@hidden>
References: 
 >How do I set a NSTextView's font in Interface Builder? (From: Daryle Walker <email@hidden>)
 >Re: How do I set a NSTextView's font in Interface Builder? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Is there a way to access other controller square's other icons programmatically?
  • Next by Date: Re: Is there a way to access other controller square's other icons programmatically?
  • Previous by thread: Re: How do I set a NSTextView's font in Interface Builder?
  • Next by thread: Re: How do I set a NSTextView's font in Interface Builder?
  • Index(es):
    • Date
    • Thread