• 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: Bold and Italic For Dictionary Font Attributes (Hillegass Chapter 20, Challenge 2)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bold and Italic For Dictionary Font Attributes (Hillegass Chapter 20, Challenge 2)


  • Subject: Re: Bold and Italic For Dictionary Font Attributes (Hillegass Chapter 20, Challenge 2)
  • From: Graham Cox <email@hidden>
  • Date: Tue, 27 Oct 2009 23:11:12 +1100


On 27/10/2009, at 10:59 PM, Chunk 1978 wrote:

while the following works, this seems to me like an awful lot of code i've
written just to change the font mask. any suggestions?


If you can't or won't use the Font Panel for some reason, what you have is about right and will get worse as you add more and more font- related traits you want to toggle or change.

But using the Font Panel is recommended as it's an interface consistent with the vast majority of apps out there (for all its flaws). In which case changing any font-oriented trait is a case of implementing a -changeFont:(id) sender method and passing the sender the currently selected font to its -convertFont: method, which does lots of things - bold, italic, size, etc. Implement a - changeAttributes:(id) sender in a similar fashion and also get shadow, colour, underline, strikethrough, etc.

This page explains:

file:///Developer/Documentation/DocSets/com.apple.adc.documentation.AppleSnowLeopard.CoreReference.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/FontPanel/Tasks/UsingFontPanel.html

--Graham


_______________________________________________

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: 
 >Bold and Italic For Dictionary Font Attributes (Hillegass Chapter 20, Challenge 2) (From: Chunk 1978 <email@hidden>)

  • Prev by Date: Bold and Italic For Dictionary Font Attributes (Hillegass Chapter 20, Challenge 2)
  • Next by Date: Interior pointer accessor list
  • Previous by thread: Bold and Italic For Dictionary Font Attributes (Hillegass Chapter 20, Challenge 2)
  • Next by thread: Re: Bold and Italic For Dictionary Font Attributes (Hillegass Chapter 20, Challenge 2)
  • Index(es):
    • Date
    • Thread