Re: New Font Panel ??
Re: New Font Panel ??
- Subject: Re: New Font Panel ??
- From: Chris Meyer <email@hidden>
- Date: Tue, 16 Mar 2004 08:57:16 -0800
See changeAttributes: and setAttributes:isMultiple: in the
NSFontManager. It is only available under Panther and it doesn't handle
color as far as I can tell.
I've requested a simplified typography system (radar #3589056) that
goes something like this, since right now the panels seem to be really
oriented around working with NSTextView only:
--------------
The idea would be that all changes affecting typography and
communication of selected typography would done using attributed
strings. Furthermore, instead of the font manager keeping a global
state which represents the change to a current font, that information
would be encapsulated in a new object (i.e. convertFont: would be
encapsulated into an object).
So my two main communications to the font manager would look like this:
- (void)mySelectionChanged
{
NSFontManager *font_manager = [NSFontManager sharedFontManager];
// get a list of attributed strings. if my selection is a range (or
ranges)
// of one or more different attributed strings, then copy the
selected substring
// out and add it in this array.
NSArray *selected_strings = [self findMySelectedStrings];
[font_manager setSelectedStrings:selected_strings];
}
// sender in this case would not be the font manager; it would be an
object which
// encapsulated the changes the font manager would make. a
'NSTypographyChanger' object?
- (void)typographyChanged:(id)sender
{
NSEnumerator *enum = [my_selected_strings objectEnumerator];
NSAttributedString *my_string;
[sender changeTypography:my_string range:[self
selectedRangeForString:my_string]];
}
--------------
On Mar 16, 2004, at 6:57 AM, Bob Miller wrote:
Hello,
Does anyone know where there is updated documentation on the usage of
the new font panel. For instance, my object receives the changeFont:
message correctly but when the color panel is brought up from within
the font panel and a color is selected, the same object does not
receive a changeColor: message. What about the other buttons at the
top of the font panel ? How does an object get messages from them ?
ie. Strikethrough, underline, color, etc...
Thanks in advance for any info
Regards,
Bob M.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.