Permalink
Browse files

Merge branch 'master' of github.com:github/twui

  • Loading branch information...
joshaber committed Jul 25, 2012
2 parents d476dae + 45309bd commit 903908e377551818e0d38fbb6d23416d6b63661c
@@ -22,8 +22,8 @@
TUITableView *_tableView;
ExampleTabBar *_tabBar;
TUIFont *exampleFont1;
TUIFont *exampleFont2;
NSFont *exampleFont1;
NSFont *exampleFont2;
}
@end
@@ -28,8 +28,8 @@ - (id)initWithFrame:(CGRect)frame
self.backgroundColor = [TUIColor colorWithWhite:0.9 alpha:1.0];
// if you're using a font a lot, it's best to allocate it once and re-use it
exampleFont1 = [TUIFont fontWithName:@"HelveticaNeue" size:15];
exampleFont2 = [TUIFont fontWithName:@"HelveticaNeue-Bold" size:15];
exampleFont1 = [NSFont fontWithName:@"HelveticaNeue" size:15];
exampleFont2 = [NSFont fontWithName:@"HelveticaNeue-Bold" size:15];
CGRect b = self.bounds;
b.origin.y += TAB_HEIGHT;
@@ -32,7 +32,6 @@
5EE983C713BE7834005F430D /* TUIControl+TargetAction.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C4B13BE6E1900C85CB5 /* TUIControl+TargetAction.m */; };
5EE983C813BE7834005F430D /* TUIControl.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C4D13BE6E1900C85CB5 /* TUIControl.m */; };
5EE983C913BE7834005F430D /* TUIFastIndexPath.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C4F13BE6E1900C85CB5 /* TUIFastIndexPath.m */; };
5EE983CA13BE7834005F430D /* TUIFont.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C5113BE6E1900C85CB5 /* TUIFont.m */; };
5EE983CB13BE7834005F430D /* TUIGeometry.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C5313BE6E1900C85CB5 /* TUIGeometry.m */; };
5EE983CC13BE7834005F430D /* TUIImage+Drawing.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C5513BE6E1900C85CB5 /* TUIImage+Drawing.m */; };
5EE983CD13BE7834005F430D /* TUIImage.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C5713BE6E1900C85CB5 /* TUIImage.m */; };
@@ -147,7 +146,6 @@
CB5E322913BE70CA004B7899 /* TUIControl+TargetAction.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C4B13BE6E1900C85CB5 /* TUIControl+TargetAction.m */; };
CB5E322B13BE70CA004B7899 /* TUIControl.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C4D13BE6E1900C85CB5 /* TUIControl.m */; };
CB5E322D13BE70CA004B7899 /* TUIFastIndexPath.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C4F13BE6E1900C85CB5 /* TUIFastIndexPath.m */; };
CB5E322F13BE70CA004B7899 /* TUIFont.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C5113BE6E1900C85CB5 /* TUIFont.m */; };
CB5E323113BE70CA004B7899 /* TUIGeometry.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C5313BE6E1900C85CB5 /* TUIGeometry.m */; };
CB5E323313BE70CA004B7899 /* TUIImage+Drawing.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C5513BE6E1900C85CB5 /* TUIImage+Drawing.m */; };
CB5E323513BE70CA004B7899 /* TUIImage.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C5713BE6E1900C85CB5 /* TUIImage.m */; };
@@ -205,8 +203,6 @@
CBB74CA413BE6E1900C85CB5 /* TUIControl.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C4D13BE6E1900C85CB5 /* TUIControl.m */; };
CBB74CA513BE6E1900C85CB5 /* TUIFastIndexPath.h in Headers */ = {isa = PBXBuildFile; fileRef = CBB74C4E13BE6E1900C85CB5 /* TUIFastIndexPath.h */; settings = {ATTRIBUTES = (Public, ); }; };
CBB74CA613BE6E1900C85CB5 /* TUIFastIndexPath.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C4F13BE6E1900C85CB5 /* TUIFastIndexPath.m */; };
CBB74CA713BE6E1900C85CB5 /* TUIFont.h in Headers */ = {isa = PBXBuildFile; fileRef = CBB74C5013BE6E1900C85CB5 /* TUIFont.h */; settings = {ATTRIBUTES = (Public, ); }; };
CBB74CA813BE6E1900C85CB5 /* TUIFont.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C5113BE6E1900C85CB5 /* TUIFont.m */; };
CBB74CA913BE6E1900C85CB5 /* TUIGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = CBB74C5213BE6E1900C85CB5 /* TUIGeometry.h */; settings = {ATTRIBUTES = (Public, ); }; };
CBB74CAA13BE6E1900C85CB5 /* TUIGeometry.m in Sources */ = {isa = PBXBuildFile; fileRef = CBB74C5313BE6E1900C85CB5 /* TUIGeometry.m */; };
CBB74CAB13BE6E1900C85CB5 /* TUIImage+Drawing.h in Headers */ = {isa = PBXBuildFile; fileRef = CBB74C5413BE6E1900C85CB5 /* TUIImage+Drawing.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -501,8 +497,6 @@
CBB74C4D13BE6E1900C85CB5 /* TUIControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TUIControl.m; sourceTree = "<group>"; };
CBB74C4E13BE6E1900C85CB5 /* TUIFastIndexPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TUIFastIndexPath.h; sourceTree = "<group>"; };
CBB74C4F13BE6E1900C85CB5 /* TUIFastIndexPath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TUIFastIndexPath.m; sourceTree = "<group>"; };
CBB74C5013BE6E1900C85CB5 /* TUIFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TUIFont.h; sourceTree = "<group>"; };
CBB74C5113BE6E1900C85CB5 /* TUIFont.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TUIFont.m; sourceTree = "<group>"; };
CBB74C5213BE6E1900C85CB5 /* TUIGeometry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TUIGeometry.h; sourceTree = "<group>"; };
CBB74C5313BE6E1900C85CB5 /* TUIGeometry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TUIGeometry.m; sourceTree = "<group>"; };
CBB74C5413BE6E1900C85CB5 /* TUIImage+Drawing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TUIImage+Drawing.h"; sourceTree = "<group>"; };
@@ -796,8 +790,6 @@
CBB74C4D13BE6E1900C85CB5 /* TUIControl.m */,
CBB74C4E13BE6E1900C85CB5 /* TUIFastIndexPath.h */,
CBB74C4F13BE6E1900C85CB5 /* TUIFastIndexPath.m */,
CBB74C5013BE6E1900C85CB5 /* TUIFont.h */,
CBB74C5113BE6E1900C85CB5 /* TUIFont.m */,
CBB74C5213BE6E1900C85CB5 /* TUIGeometry.h */,
CBB74C5313BE6E1900C85CB5 /* TUIGeometry.m */,
D0C7650415B6156A00E7AC2C /* TUIHostView.h */,
@@ -968,7 +960,6 @@
CBB74CA013BE6E1900C85CB5 /* TUIColor.h in Headers */,
CBB74CA313BE6E1900C85CB5 /* TUIControl.h in Headers */,
CBB74CA513BE6E1900C85CB5 /* TUIFastIndexPath.h in Headers */,
CBB74CA713BE6E1900C85CB5 /* TUIFont.h in Headers */,
CBB74CA913BE6E1900C85CB5 /* TUIGeometry.h in Headers */,
CBB74CAB13BE6E1900C85CB5 /* TUIImage+Drawing.h in Headers */,
88D81CFF1577EF0D009D453B /* TUIStyledView.h in Headers */,
@@ -1282,7 +1273,6 @@
5EE983C713BE7834005F430D /* TUIControl+TargetAction.m in Sources */,
5EE983C813BE7834005F430D /* TUIControl.m in Sources */,
5EE983C913BE7834005F430D /* TUIFastIndexPath.m in Sources */,
5EE983CA13BE7834005F430D /* TUIFont.m in Sources */,
5EE983CB13BE7834005F430D /* TUIGeometry.m in Sources */,
5EE983CC13BE7834005F430D /* TUIImage+Drawing.m in Sources */,
5EE983CD13BE7834005F430D /* TUIImage.m in Sources */,
@@ -1357,7 +1347,6 @@
CBB74CA213BE6E1900C85CB5 /* TUIControl+TargetAction.m in Sources */,
CBB74CA413BE6E1900C85CB5 /* TUIControl.m in Sources */,
CBB74CA613BE6E1900C85CB5 /* TUIFastIndexPath.m in Sources */,
CBB74CA813BE6E1900C85CB5 /* TUIFont.m in Sources */,
CBB74CAA13BE6E1900C85CB5 /* TUIGeometry.m in Sources */,
CBB74CAC13BE6E1900C85CB5 /* TUIImage+Drawing.m in Sources */,
CBB74CAE13BE6E1900C85CB5 /* TUIImage.m in Sources */,
@@ -1445,7 +1434,6 @@
CB5E322913BE70CA004B7899 /* TUIControl+TargetAction.m in Sources */,
CB5E322B13BE70CA004B7899 /* TUIControl.m in Sources */,
CB5E322D13BE70CA004B7899 /* TUIFastIndexPath.m in Sources */,
CB5E322F13BE70CA004B7899 /* TUIFont.m in Sources */,
CB5E323113BE70CA004B7899 /* TUIGeometry.m in Sources */,
CB5E323313BE70CA004B7899 /* TUIImage+Drawing.m in Sources */,
CB5E323513BE70CA004B7899 /* TUIImage.m in Sources */,
@@ -20,7 +20,6 @@ extern NSString * const TUIAttributedStringBackgroundColorAttributeName;
extern NSString * const TUIAttributedStringBackgroundFillStyleName;
extern NSString * const TUIAttributedStringPreDrawBlockName;
@class TUIFont;
@class TUIColor;
typedef void (^TUIAttributedStringPreDrawBlock)(NSAttributedString *attributedString, NSRange substringRange, CGRect rects[], CFIndex rectCount);
@@ -61,7 +60,7 @@ typedef enum {
@interface NSMutableAttributedString (TUIAdditions)
// write-only properties, reading will return nil
@property (nonatomic, retain) TUIFont *font;
@property (nonatomic, retain) NSFont *font;
@property (nonatomic, retain) TUIColor *color;
@property (nonatomic, retain) TUIColor *backgroundColor;
@property (nonatomic, assign) TUIBackgroundFillStyle backgroundFillStyle;
@@ -74,7 +73,7 @@ typedef enum {
- (void)setAlignment:(TUITextAlignment)alignment lineBreakMode:(TUILineBreakMode)lineBreakMode;
- (NSRange)_stringRange;
- (void)setFont:(TUIFont *)font inRange:(NSRange)range;
- (void)setFont:(NSFont *)font inRange:(NSRange)range;
- (void)setColor:(TUIColor *)color inRange:(NSRange)range;
- (void)setBackgroundColor:(TUIColor *)color inRange:(NSRange)range;
- (void)setBackgroundFillStyle:(TUIBackgroundFillStyle)fillStyle inRange:(NSRange)range;
@@ -15,7 +15,6 @@
*/
#import "TUIAttributedString.h"
#import "TUIFont.h"
#import "TUIColor.h"
NSString * const TUIAttributedStringBackgroundColorAttributeName = @"TUIAttributedStringBackgroundColorAttributeName";
@@ -38,9 +37,10 @@ - (NSRange)_stringRange
return NSMakeRange(0, [self length]);
}
- (void)setFont:(TUIFont *)font inRange:(NSRange)range
- (void)setFont:(NSFont *)font inRange:(NSRange)range
{
[self addAttribute:(NSString *)kCTFontAttributeName value:(id)[font ctFont] range:range];
// NSFont and CTFont are toll-free bridged.
[self addAttribute:(NSString *)kCTFontAttributeName value:font range:range];
}
- (void)setColor:(TUIColor *)color inRange:(NSRange)range
@@ -58,7 +58,7 @@ - (void)setKerning:(CGFloat)k inRange:(NSRange)range
[self addAttribute:(NSString *)kCTKernAttributeName value:[NSNumber numberWithFloat:k] range:range];
}
- (void)setFont:(TUIFont *)font
- (void)setFont:(NSFont *)font
{
[self setFont:font inRange:[self _stringRange]];
}
@@ -199,7 +199,7 @@ - (void)setAlignment:(TUITextAlignment)alignment
[self setAlignment:alignment lineBreakMode:TUILineBreakModeWordWrap];
}
- (TUIFont *)font
- (NSFont *)font
{
return nil;
}
View

This file was deleted.

Oops, something went wrong.
View

This file was deleted.

Oops, something went wrong.
View
@@ -29,7 +29,6 @@
#import "TUICGAdditions.h"
#import "TUIColor.h"
#import "TUIFastIndexPath.h"
#import "TUIFont.h"
#import "TUIHostView.h"
#import "TUIImage.h"
#import "TUIImageView.h"
View
@@ -30,7 +30,7 @@
} _textLabelFlags;
NSString *_text;
TUIFont *_font;
NSFont *_font;
TUIColor *_textColor;
TUITextAlignment _alignment;
TUILineBreakMode _lineBreakMode;
@@ -41,7 +41,7 @@
@property(nonatomic,getter=isSelectable) BOOL selectable;
@property(nonatomic, readonly) TUITextRenderer *renderer;
@property(nonatomic,strong) TUIFont *font;
@property(nonatomic,strong) NSFont *font;
@property(nonatomic,strong) TUIColor *textColor;
@property(nonatomic,assign) TUITextAlignment alignment;
@property(nonatomic, assign) TUILineBreakMode lineBreakMode;
View
@@ -16,7 +16,6 @@
#import "TUILabel.h"
#import "TUIColor.h"
#import "TUIFont.h"
#import "TUINSView.h"
#import "TUIStringDrawing.h"
#import "TUITextRenderer.h"
@@ -130,7 +129,7 @@ - (void)setText:(NSString *)text
self.attributedString = nil;
}
- (void)setFont:(TUIFont *)font
- (void)setFont:(NSFont *)font
{
if(font == _font) return;
Oops, something went wrong.

0 comments on commit 903908e

Please sign in to comment.