I would like to open the NSFontPanel with a font (in the following example Helevtica) selected initially. I mean that when the font panel shows up, the collection and family values are selected. Here is my code:
NSFontManager * fontManager = [NSFontManager sharedFontManager];
[fontManager setTarget:self];
[fontManager setSelectedFont:[NSFont fontWithName:@"Helvetica" size:150.0]; isMultiple:NO];
[fontManager orderFrontFontPanel:self];
Why does the Helvetica font not show up selected in the font panel?
I am also using NSFontPanelValidation protocol, here is the code:
- (NSUInteger)validModesForFontPanel:(NSFontPanel *)fontPanel
{
return NSFontPanelFaceModeMask | NSFontPanelCollectionModeMask | NSFontPanelUnderlineEffectModeMask | NSFontPanelStrikethroughEffectModeMask;
}