< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m

Print this page

        

*** 64,78 **** fNativeCGFont = NULL; } [super finalize]; } + (AWTFont *) awtFontForName:(NSString *)name style:(int)style { // create font with family & size ! NSFont *nsFont = [NSFont fontWithName:name size:1.0]; if (nsFont == nil) { // if can't get font of that name, substitute system default font nsFont = [NSFont fontWithName:@"Lucida Grande" size:1.0]; #ifdef DEBUG --- 64,99 ---- fNativeCGFont = NULL; } [super finalize]; } + static NSString* uiName = nil; + static NSString* uiBoldName = nil; + + (AWTFont *) awtFontForName:(NSString *)name style:(int)style { // create font with family & size ! NSFont *nsFont = nil; ! ! if ((uiName != nil && [name isEqualTo:uiName]) || ! (uiBoldName != nil && [name isEqualTo:uiBoldName])) { ! if (style & java_awt_Font_BOLD) { ! nsFont = [NSFont boldSystemFontOfSize:1.0]; ! } else { ! nsFont = [NSFont systemFontOfSize:1.0]; ! } ! #ifdef DEBUG ! NSLog(@"nsFont-name is : %@", nsFont.familyName); ! NSLog(@"nsFont-family is : %@", nsFont.fontName); ! NSLog(@"nsFont-desc-name is : %@", nsFont.fontDescriptor.postscriptName); ! #endif ! ! ! } else { ! nsFont = [NSFont fontWithName:name size:1.0]; ! } if (nsFont == nil) { // if can't get font of that name, substitute system default font nsFont = [NSFont fontWithName:@"Lucida Grande" size:1.0]; #ifdef DEBUG
*** 186,195 **** --- 207,222 ---- CFRelease(family); CFRelease(desc); CFRelease(font); return; } + if (uiType == kCTFontUIFontSystem) { + uiName = (NSString*)name; + } + if (uiType == kCTFontUIFontEmphasizedSystem) { + uiBoldName = (NSString*)name; + } [allFonts addObject:name]; [fontFamilyTable setObject:family forKey:name]; #ifdef DEBUG NSLog(@"name is : %@", (NSString*)name); NSLog(@"family is : %@", (NSString*)family);
*** 240,250 **** * although these may include fonts that are enumerated normally * they also demonstrably includes fonts that are not. */ addFont(kCTFontUIFontSystem, allFonts, fontFamilyTable); addFont(kCTFontUIFontEmphasizedSystem, allFonts, fontFamilyTable); - addFont(kCTFontUIFontUserFixedPitch, allFonts, fontFamilyTable); sFilteredFonts = allFonts; sFontFamilyTable = fontFamilyTable; } --- 267,276 ----
< prev index next >