//
//  CHStringAdditions.h
//  Chocolat
//
//  Created by Pieter Omvlee on 8/10/08.
//  Copyright 2008 Insearchofaname. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "CHStringDrawingAdditions.h"
#import "CHArrayExtensions.h"

@interface NSString (CHStringAdditions)
- (float)heightWithFont:(NSFont *)myFont maxWidth:(float)myWidth;

- (int)fontSizeToFitStringWithAttributes:(CHStringAttributes *)attributes inSize:(NSSize)aSize maximumFontSize:(int)maxSize;
- (int)fontSizeToFitStringWithAttributes:(CHStringAttributes *)attributes inSize:(NSSize)aSize;
- (int)fontSizeToFitStringWithAttributes:(CHStringAttributes *)attributes inWidth:(int)width;
- (int)fontSizeToFitStringWithAttributes:(CHStringAttributes *)attributes inHeight:(int)height;

- (void)fitStringAttributes:(CHStringAttributes *)attributes inSize:(NSSize)aSize;
- (void)fitStringAttributes:(CHStringAttributes *)attributes inWidth:(int)width;
- (void)fitStringAttributes:(CHStringAttributes *)attributes inHeight:(int)height;

- (BOOL)containsSubstring:(NSString *)sub;

- (NSArray *)words;
@end

@interface NSAttributedString (CHAttributedStringAdditions)
- (float)heightWithFont:(NSFont *)myFont maxWidth:(float)myWidth;
@end
