How to enable/disable the menu items Font > Bold/Italic on Leopard?

  • Hi,

    I'm changing the font traits bold and italic in my app not directly
    in an NSTextField or NSTextView, but for one or multiple selected
    objects. I'm using NSFontManger and set the current font or fonts for
    the selected objects with setSelectedFont:isMultiple: depending on a
    single or mutiple selection.

    In validateMenuItem: for the menu items Font > Bold/Italic I'm using
    [[NSFontManager sharedFontManager] validateMenuItem:menuItem] to
    detect whether the font trait bold or italic is available for the
    selected fonts or not. This works fine on Tiger but doesn't seem to
    work on Leopard, as this method always returns YES on Leopard even
    when the currently selected font of the shared NSFontManger doesn't
    support this font trait.

    Any hints how I can easily detect on Leopard whether the menu items
    Font > Bold/Italic can be used/enabled to change the traits bold/
    italic for the currently selected font of the shared NSFontManger?

    Regards,

        Daniel
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today