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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to