Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed class that has been deprecated with the 'AppFonts' key in the…

… info.plist file
  • Loading branch information...
commit 10d9301aa5e26cebf74c9ce936d038f7e56da96a 1 parent d92097a
Adrian Kosmaczewski authored
4 Classes/AppDelegate/CoreTextWrapperAppDelegate.m
View
@@ -20,7 +20,7 @@ @implementation CoreTextWrapperAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
- [self.window addSubview:self.pageController.view];
+ self.window.rootViewController = self.pageController;
[self.window makeKeyAndVisible];
return YES;
@@ -31,7 +31,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
- (void)dealloc
{
- [self.window release];
+ [_window release];
[super dealloc];
}
5 Classes/Controllers/PageController.h
View
@@ -11,18 +11,17 @@
@class AKOMultiPageTextView;
-@class AKOCustomFontLabel;
@interface PageController : UIViewController <AKOMultiColumnTextViewDataSource>
{
@private
AKOMultiPageTextView *_multiPageView;
- AKOCustomFontLabel *_label;
+ UILabel *_label;
CGFloat _previousScale;
CGFloat _fontSize;
}
-@property (nonatomic, retain) IBOutlet AKOCustomFontLabel *label;
+@property (nonatomic, retain) IBOutlet UILabel *label;
@property (nonatomic, retain) IBOutlet AKOMultiPageTextView *multiPageView;
@end
3  Classes/Controllers/PageController.m
View
@@ -8,7 +8,6 @@
#import "PageController.h"
#import "AKOMultiPageTextView.h"
-#import "AKOCustomFontLabel.h"
#import "NSString+BundleExtensions.h"
#import "UIFont+CoreTextExtensions.h"
@@ -41,7 +40,7 @@ - (void)viewDidLoad
{
[super viewDidLoad];
self.label.text = @"News of the Day";
- self.label.font = [UIFont bundledFontNamed:@"Polsku" size:34.0];
+ self.label.font = [UIFont fontWithName:@"Polsku" size:34.0];
self.label.shadowColor = [UIColor lightGrayColor];
self.label.shadowOffset = CGSizeMake(2, 2);
31 Classes/Views/AKOCustomFontLabel.h
View
@@ -1,31 +0,0 @@
-//
-// AKOCustomFontView.h
-// CoreTextWrapper
-//
-// Created by Adrian on 6/19/10.
-// Copyright 2010 akosma software. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-#import <CoreText/CoreText.h>
-
-@interface AKOCustomFontLabel : UIView
-{
-@private
- CTFontRef _font;
- NSString *_text;
- UIColor *_textColor;
- UIColor *_shadowColor;
- CGSize _shadowOffset;
- AKOCustomFontLabel *_shadowSubview;
-}
-
-@property (nonatomic, copy) NSString *text;
-@property (nonatomic, retain) UIColor *textColor;
-@property (nonatomic, retain) UIColor *shadowColor;
-@property (nonatomic, assign) CGSize shadowOffset;
-
-- (CTFontRef)font;
-- (void)setFont:(CTFontRef)customFont;
-
-@end
200 Classes/Views/AKOCustomFontLabel.m
View
@@ -1,200 +0,0 @@
-//
-// AKOCustomFontView.m
-// CoreTextWrapper
-//
-// Created by Adrian on 6/19/10.
-// Copyright 2010 akosma software. All rights reserved.
-//
-
-#import "AKOCustomFontLabel.h"
-#import "UIFont+CoreTextExtensions.h"
-
-@interface AKOCustomFontLabel ()
-
-- (void)setup;
-
-@end
-
-
-@implementation AKOCustomFontLabel
-
-@dynamic text;
-@dynamic textColor;
-@dynamic shadowOffset;
-@dynamic shadowColor;
-
-#pragma mark -
-#pragma mark Init and dealloc
-
-- (id)initWithCoder:(NSCoder *)aDecoder
-{
- if ((self = [super initWithCoder:aDecoder]))
- {
- [self setup];
- }
- return self;
-}
-
-- (id)initWithFrame:(CGRect)frame
-{
- if ((self = [super initWithFrame:frame]))
- {
- [self setup];
- }
- return self;
-}
-
-- (void)setup
-{
- self.font = [UIFont systemFontOfSize:17.0].CTFont;
- self.textColor = [UIColor blackColor];
- self.text = @"";
- self.shadowColor = [UIColor whiteColor];
- self.shadowOffset = CGSizeMake(0,0);
-}
-
-- (void)dealloc
-{
- self.text = nil;
- self.textColor = nil;
- self.font = nil;
- self.shadowColor = nil;
- [super dealloc];
-}
-
-#pragma mark -
-#pragma mark UIView methods
-
-- (void)drawRect:(CGRect)rect
-{
- CGContextRef context = UIGraphicsGetCurrentContext();
-
- CGAffineTransform shadowFlip = CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0, self.frame.size.height);
- CGContextConcatCTM(context, shadowFlip);
-
- if ((_shadowOffset.width != 0) || (_shadowOffset.height != 0)) {
- // Initialize string, font, and context
- CFStringRef shadowKeys[] = { kCTFontAttributeName, kCTForegroundColorAttributeName };
- CFTypeRef shadowValues[] = { self.font, self.shadowColor.CGColor };
-
- CFDictionaryRef shadowAttributes =
- CFDictionaryCreate(kCFAllocatorDefault, (const void**)&shadowKeys,
- (const void**)&shadowValues, sizeof(shadowKeys) / sizeof(shadowKeys[0]),
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
-
- CFAttributedStringRef shadowAttrString = CFAttributedStringCreate(kCFAllocatorDefault, (CFStringRef)self.text, shadowAttributes);
- CFRelease(shadowAttributes);
-
- CTLineRef shadowLine = CTLineCreateWithAttributedString(shadowAttrString);
- CFRelease(shadowAttrString);
-
- // Set text position and draw the line into the graphics context
- CGContextSetTextPosition(context, _shadowOffset.width, 20.0-_shadowOffset.height);
- CTLineDraw(shadowLine, context);
- }
-
-
-
- // Initialize string, font, and context
- CFStringRef keys[] = { kCTFontAttributeName, kCTForegroundColorAttributeName };
- CFTypeRef values[] = { self.font, self.textColor.CGColor };
-
- CFDictionaryRef attributes =
- CFDictionaryCreate(kCFAllocatorDefault, (const void**)&keys,
- (const void**)&values, sizeof(keys) / sizeof(keys[0]),
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
-
- CFAttributedStringRef attrString = CFAttributedStringCreate(kCFAllocatorDefault, (CFStringRef)self.text, attributes);
- CFRelease(attributes);
-
- CTLineRef line = CTLineCreateWithAttributedString(attrString);
- CFRelease(attrString);
-
- // Set text position and draw the line into the graphics context
- CGContextSetTextPosition(context, 0.0, 20.0);
- CTLineDraw(line, context);
- CFRelease(line);
-}
-
-#pragma mark -
-#pragma mark Setters and getters
-
-- (NSString *)text
-{
- return _text;
-}
-
-- (void)setText:(NSString *)newText
-{
- if (![self.text isEqualToString:newText])
- {
- [_text release];
- _text = [newText copy];
-
- [self setNeedsDisplay];
- }
-}
-
-- (UIColor *)textColor
-{
- return _textColor;
-}
-
-- (void)setTextColor:(UIColor *)newColor
-{
- if (newColor != self.textColor)
- {
- [_textColor release];
- _textColor = [newColor retain];
-
- [self setNeedsDisplay];
- }
-}
-
-- (CTFontRef)font
-{
- return _font;
-}
-
-- (void)setFont:(CTFontRef)newFont
-{
- if (_font != NULL)
- {
- CFRelease(_font);
- }
- _font = CFRetain(newFont);
- [self setNeedsDisplay];
-}
-
-
-- (UIColor *)shadowColor
-{
- return _shadowColor;
-}
-
-- (void)setShadowColor:(UIColor *)newColor
-{
- if (newColor != self.shadowColor)
- {
- [_shadowColor release];
- _shadowColor = [newColor retain];
- _shadowSubview.textColor = _shadowColor;
-
- [self setNeedsDisplay];
- }
-}
-
-- (CGSize)shadowOffset
-{
- return _shadowOffset;
-}
-
-- (void)setShadowOffset:(CGSize)newShadowOffset
-{
- _shadowOffset = newShadowOffset;
- [self setNeedsDisplay];
-}
-
-@end
4 CoreTextWrapper-Info.plist
View
@@ -26,6 +26,10 @@
<true/>
<key>NSMainNibFile</key>
<string>MainWindow</string>
+ <key>UIAppFonts</key>
+ <array>
+ <string>Polsku.ttf</string>
+ </array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
6 CoreTextWrapper.xcodeproj/project.pbxproj
View
@@ -11,7 +11,6 @@
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; };
- 3A741AD811E5D932007CA229 /* AKOCustomFontLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A741AD711E5D932007CA229 /* AKOCustomFontLabel.m */; };
3A741B2411E5DF73007CA229 /* Polsku.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3A741B2311E5DF73007CA229 /* Polsku.ttf */; };
3ACEB36E11E5CF6C005316CD /* CoreTextWrapperAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3ACEB36C11E5CF6C005316CD /* CoreTextWrapperAppDelegate.m */; };
3ACEB37211E5CF78005316CD /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3ACEB37111E5CF78005316CD /* MainWindow.xib */; };
@@ -32,8 +31,6 @@
288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* CoreTextWrapper_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreTextWrapper_Prefix.pch; sourceTree = "<group>"; };
- 3A741AD611E5D932007CA229 /* AKOCustomFontLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AKOCustomFontLabel.h; sourceTree = "<group>"; };
- 3A741AD711E5D932007CA229 /* AKOCustomFontLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AKOCustomFontLabel.m; sourceTree = "<group>"; };
3A741B2311E5DF73007CA229 /* Polsku.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = Polsku.ttf; sourceTree = "<group>"; };
3ACEB36B11E5CF6C005316CD /* CoreTextWrapperAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreTextWrapperAppDelegate.h; sourceTree = "<group>"; };
3ACEB36C11E5CF6C005316CD /* CoreTextWrapperAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreTextWrapperAppDelegate.m; sourceTree = "<group>"; };
@@ -191,8 +188,6 @@
3ACEB38E11E5CFD4005316CD /* Views */ = {
isa = PBXGroup;
children = (
- 3A741AD611E5D932007CA229 /* AKOCustomFontLabel.h */,
- 3A741AD711E5D932007CA229 /* AKOCustomFontLabel.m */,
3ACEB38F11E5CFD4005316CD /* AKOMultiColumnTextView.h */,
3ACEB39011E5CFD4005316CD /* AKOMultiColumnTextView.m */,
3ACEB39111E5CFD4005316CD /* AKOMultiPageTextView.h */,
@@ -284,7 +279,6 @@
3ACEB39311E5CFD4005316CD /* AKOMultiColumnTextView.m in Sources */,
3ACEB39411E5CFD4005316CD /* AKOMultiPageTextView.m in Sources */,
3ACEB3A211E5D070005316CD /* PageController.m in Sources */,
- 3A741AD811E5D932007CA229 /* AKOCustomFontLabel.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
102 Resources/NIBs/PageController.xib
View
@@ -1,30 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">
<data>
- <int key="IBDocument.SystemTarget">800</int>
- <string key="IBDocument.SystemVersion">10J3250</string>
- <string key="IBDocument.InterfaceBuilderVersion">1306</string>
- <string key="IBDocument.AppKitVersion">1038.35</string>
- <string key="IBDocument.HIToolboxVersion">461.00</string>
+ <int key="IBDocument.SystemTarget">1280</int>
+ <string key="IBDocument.SystemVersion">11D50b</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1938</string>
+ <string key="IBDocument.AppKitVersion">1138.32</string>
+ <string key="IBDocument.HIToolboxVersion">568.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">301</string>
+ <string key="NS.object.0">933</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>IBProxyObject</string>
<string>IBUIView</string>
+ <string>IBUILabel</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys" id="0">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- <reference key="dict.values" ref="0"/>
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -47,31 +45,49 @@
<string key="NSFrame">{{0, 96}, {1024, 652}}</string>
<reference key="NSSuperview" ref="766721923"/>
<reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor" id="50803128">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
- <object class="IBUIView" id="912688252">
+ <object class="IBUILabel" id="876557051">
<reference key="NSNextResponder" ref="766721923"/>
- <int key="NSvFlags">293</int>
- <string key="NSFrame">{{312, 20}, {402, 68}}</string>
+ <int key="NSvFlags">301</int>
+ <string key="NSFrame">{{322, 30}, {402, 68}}</string>
<reference key="NSSuperview" ref="766721923"/>
<reference key="NSWindow"/>
- <object class="NSColor" key="IBUIBackgroundColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MQA</bytes>
- <object class="NSColorSpace" key="NSCustomColorSpace">
- <int key="NSID">2</int>
- </object>
- </object>
+ <string key="NSReuseIdentifierKey">_NS:345</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">7</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ <string key="IBUIText">Label</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDAAA</bytes>
+ </object>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ <int key="IBUITextAlignment">1</int>
+ <object class="IBUIFontDescription" key="IBUIFontDescription">
+ <int key="type">1</int>
+ <double key="pointSize">17</double>
+ </object>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">17</double>
+ <int key="NSfFlags">16</int>
+ </object>
</object>
</object>
<string key="NSFrame">{{0, 20}, {1024, 748}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
<reference key="IBUIBackgroundColor" ref="50803128"/>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
@@ -107,9 +123,9 @@
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">label</string>
<reference key="source" ref="841351856"/>
- <reference key="destination" ref="912688252"/>
+ <reference key="destination" ref="876557051"/>
</object>
- <int key="connectionID">9</int>
+ <int key="connectionID">12</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -117,7 +133,9 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
- <reference key="object" ref="0"/>
+ <object class="NSArray" key="object" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
@@ -138,7 +156,7 @@
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="547224021"/>
- <reference ref="912688252"/>
+ <reference ref="876557051"/>
</object>
<reference key="parent" ref="0"/>
</object>
@@ -151,8 +169,8 @@
<reference key="parent" ref="766721923"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">8</int>
- <reference key="object" ref="912688252"/>
+ <int key="objectID">11</int>
+ <reference key="object" ref="876557051"/>
<reference key="parent" ref="766721923"/>
</object>
</object>
@@ -162,23 +180,23 @@
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
+ <string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
- <string>2.IBEditorWindowLastContentRect</string>
+ <string>-2.IBPluginDependency</string>
+ <string>11.IBPluginDependency</string>
<string>2.IBPluginDependency</string>
<string>5.CustomClassName</string>
<string>5.IBPluginDependency</string>
- <string>8.CustomClassName</string>
- <string>8.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>PageController</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
- <string>{{51, 260}, {1024, 768}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string>AKOMultiPageTextView</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string>AKOCustomFontLabel</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>AKOMultiPageTextView</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
@@ -194,20 +212,12 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
- <int key="maxID">9</int>
+ <int key="maxID">12</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
- <string key="className">AKOCustomFontLabel</string>
- <string key="superclassName">UIView</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/AKOCustomFontLabel.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
<string key="className">AKOMultiPageTextView</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -227,7 +237,7 @@
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>AKOCustomFontLabel</string>
+ <string>UILabel</string>
<string>AKOMultiPageTextView</string>
</object>
</object>
@@ -242,7 +252,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">label</string>
- <string key="candidateClassName">AKOCustomFontLabel</string>
+ <string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">multiPageView</string>
@@ -261,7 +271,7 @@
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
- <integer value="800" key="NS.object.0"/>
+ <real value="1280" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
@@ -269,6 +279,6 @@
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">301</string>
+ <string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
Please sign in to comment.
Something went wrong with that request. Please try again.