• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why is NSFontManager lying to me ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is NSFontManager lying to me ?


  • Subject: Re: Why is NSFontManager lying to me ?
  • From: Pascal Pochet <email@hidden>
  • Date: Mon, 27 Feb 2006 20:13:26 +0100

A quick test done here

#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>

int main(int argc,char **argv)
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]  ;

NSEnumerator * fontList = [[[NSFontManager sharedFontManager] availableFonts] objectEnumerator];
NSString *fontName ;


    while ( fontName = [fontList nextObject] )
    {
         NSFont* font =
              [NSFont fontWithName: fontName size: 18.0];

        if (font == nil)
            NSLog(@"problem with %@",fontName)  ;
		else
			NSLog(@"OK %@",fontName)	;
    }

    [pool release]  ;
    return 0    ;
}

$ cc -o testfonts -framework Foundation -framework AppKit testfonts.m
$ ./testfonts 2>&1 | grep Gloucester
2006-02-27 20:06:40.492 testfonts[278] OK GloucesterMT-ExtraCondensed

$ ./testfonts 2>&1 | grep Abadi
2006-02-27 20:11:51.814 testfonts[283] OK AbadiMT-CondensedExtraBold
2006-02-27 20:11:51.831 testfonts[283] OK AbadiMT-CondensedLight

You may have to investigate more… but at least run this simple test…
to see if the problem is context free or not…


Pascal Pochet email@hidden


Le 27-févr.-06 à 14:10, Robert Clair a écrit :

NSArray* fontList = [[NSFontManager sharedFontManager] availableFonts];
int fontCount = [fontList count];
for ( j=0; j < fontCount; j++ )
{
NSFont* font =
[NSFont fontWithName: [fontList objectAtIndex: j] size: 18.0];


NSDictionary* fontStringAttributes =
[NSDictionary dictionaryWithObject: font
forKey: NSFontAttributeName];


          ...

}




_______________________________________________
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


References: 
 >Why is NSFontManager lying to me ? (From: Robert Clair <email@hidden>)

  • Prev by Date: Re: Menu Item Hot Key
  • Next by Date: Re: Problem using NSWorkspace to copy a package
  • Previous by thread: Re: Why is NSFontManager lying to me ?
  • Next by thread: [CORE DATA] multithreading
  • Index(es):
    • Date
    • Thread