Changeset 13
- Timestamp:
- 12/15/2002 09:28:32 AM (6 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/adium/Frameworks/AIUtilities Framework/AITextAttributes.m
r4 r13 19 19 20 20 #import "AITextAttributes.h" 21 #define FONT_DEFAULT_NAME @"Helvetica" 21 22 22 23 @interface AITextAttributes (PRIVATE) … … 120 121 - (void)updateFont 121 122 { 122 [dictionary setObject:[[NSFontManager sharedFontManager] fontWithFamily:fontFamilyName traits:fontTraitsMask weight:5 size:fontSize] forKey:NSFontAttributeName]; 123 NSFont *font = nil; 124 125 //Ensure font size isn't 0 126 if(!fontSize) fontSize = 12; 127 128 //Create the font 129 if(fontFamilyName){ 130 font = [[NSFontManager sharedFontManager] fontWithFamily:fontFamilyName traits:fontTraitsMask weight:5 size:fontSize]; 131 } 123 132 133 //If no name was specified or the font is not available, use the default font 134 if(!font){ 135 font = [[NSFontManager sharedFontManager] fontWithFamily:FONT_DEFAULT_NAME traits:fontTraitsMask weight:5 size:fontSize]; 136 } 137 138 if(font){ //Just to be safe, incase the default font was unavailable for some reason 139 [dictionary setObject:font forKey:NSFontAttributeName]; 140 } 124 141 } 125 142