ignoring font family in font panel
ignoring font family in font panel
- Subject: ignoring font family in font panel
- From: Ken Victor <email@hidden>
- Date: Thu, 6 Oct 2005 16:27:17 -0700
i have a window that displays menu item titles and the associated
keyboard shortcuts. (the window actually uses a bindings controlled
outline view, but i don't think that is relevant to my problem).
because of the contents of this view, i wish to always use the menu
bar font. however, i would like the user to be able to specify font
size via the "normal" approach of selecting a size from the font
panel. in my NSFontManager delegate i have implemented
validModesForFontPanel as follows:
- (unsigned int) validModesForFontPanel: (NSFontPanel*) fontPanel {
return NSFontPanelSizeModeMask;
};
however, the font panel still displays font family names. i am able
to effectively ignore user clicks on a new family in my change font
method in my delegate, but this is misleading to the user in that (a)
the user is lead to believe that clicking on a family will have some
effect and (b) the font panel selects the family the user clicked on,
even though i haven't changed it in my change font method. here is
my change font method:
- (void) changeFont: (id) sender {
NSFont* oldFont = [NSFont menuBarFontOfSize: [self fontSize]];
NSFont* newFont = [sender convertFont: oldFont];
newFont = [sender convertFont: oldFont toSize: [newFont pointSize]];
[self setFontSize: [newFont pointSize];
[sender setSelectedFont: [NSFont menuBarFontOfSize: [self
fontSize] isMultiple: NO];
};
in case it helps, i "invoke" the font panel in response to a user
click on the NSToolbarShowFontsItemIdentifier toolbar item as follows:
- (void) showFontPanel: (id) sender {
NSFontManager* fm = [NSFontManager sharedFontManager];
[fm setSelectedFont: [NSFont menuBarFontOfSize: [self
fontSize] isMultiple: NO];
[fm setDelegate: self];
[fm orderFrontFontPanel: self];
};
so... is it possible to have a font panel that only shows sizes? if
so, how? if not, how can i get the font panel to reselect the
appropriate menu bar font (Lucida Grande) after the user has made a
"useless" selection of another family?
thanx,
ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden