I tried to create NSFont using fontDescriptorWithFontAttributes but NSFont return's null.
I want to set the font name, size, weight and slant.
Can any body tell me what is wrong with this code, please suggest a right way of creating the NSFont...
Regards,
anni
I want to set the font name, size, weight and slant.
NSDictionary *fontTraits = [NSDictionary dictionaryWithObjectsAndKeys:400, NSFontWeightTrait, 1.0, NSFontSlantTrait, nil];
//Create a dictionary with font attributes
NSDictionary *fontAttributes = [NSDictionary dictionaryWithObjectsAndKeys"Arial", NSFontFaceAttribute, fontTraits, NSFontTraitsAttribute, nil];
NSFontDescriptor *fontDescriptor = [NSFontDescriptor fontDescriptorWithFontAttributes:fontAttributes];
//Create a NSFont
NSFont *nsFont = [NSFont fontWithDescriptor:fontDescriptor size:12];
Can any body tell me what is wrong with this code, please suggest a right way of creating the NSFont...
Regards,
anni