jshoward
3/8/2013 - 2:22 PM

gistfile1.txt

 
    NSMutableParagraphStyle * paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
    [paragraphStyle setAlignment:NSCenterTextAlignment];
    [paragraphStyle setLineBreakMode:NSLineBreakByTruncatingTail];
    
    
    NSFont *font1 = [NSFont fontWithName:@"HelveticaNeue-Medium" size:12];
    NSFont *font2 = [NSFont fontWithName:@"HelveticaNeue-Medium" size:24];
    
    NSDictionary *attributes1 = @{NSFontAttributeName : font1, NSParagraphStyleAttributeName : paragraphStyle};
    NSDictionary *attributes2 = @{NSFontAttributeName : font2, NSParagraphStyleAttributeName : paragraphStyle};
    
    CGSize size1 = [@"Foobar" sizeWithAttributes:attributes1];
    CGSize size2 = [@"Foobar" sizeWithAttributes:attributes2];
 
 
(lldb) p size1
(CGSize) $0 = (width=39.576, height=19)
(lldb) p size2
(CGSize) $1 = (width=79.152, height=29)