Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

New Framework definition. Fixed CSS regexp.

  • Loading branch information...
commit 608c85d6e2619549cfc3b09a5039e58fb0a0172e 1 parent 4853bc9
Christian Beer authored
View
6 Core/Source/NSString+CSS.m
@@ -38,7 +38,7 @@ - (CGFloat)pixelSizeOfCSSMeasureRelativeToCurrentTextSize:(CGFloat)textSize unit
NSError *error = nil;
static NSRegularExpression *numericRegex = nil;
if (!numericRegex) {
- numericRegex = [NSRegularExpression regularExpressionWithPattern:@"^([+-]?)(\\d*\\.\\d+|\\d+)([a-z]*|%?)" options:0 error:&error];
+ numericRegex = [NSRegularExpression regularExpressionWithPattern:@"^([+-]?)(\\d*\\.\\d+|\\d+)(%|[a-z]*)" options:0 error:&error];
}
NSArray *matches = [numericRegex matchesInString:self options:NSMatchingAnchored range:(NSRange){0, self.length}];
@@ -65,6 +65,10 @@ - (CGFloat)pixelSizeOfCSSMeasureRelativeToCurrentTextSize:(CGFloat)textSize unit
value = value * textSize / 100.0f;
} else if ([@"em" isEqualToString:unit]) {
value = value * textSize;
+ } else if ([@"pt" isEqualToString:unit] || [@"px" isEqualToString:unit]) {
+ // intentionally do nothin'
+ } else {
+ NSLog(@"!!! unknown unit: %@", unit);
}
if (outUnit) {
View
30 DTCoreText/DTCoreText-Info.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.drobnik.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2012 Christian Beer. All rights reserved.</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+</dict>
+</plist>
View
7 DTCoreText/DTCoreText-Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'DTCoreText' target in the 'DTCoreText' project
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
View
13 DTCoreText/DTCoreText.h
@@ -0,0 +1,13 @@
+//
+// DTCoreText.h
+// DTCoreText
+//
+// Created by Christian Beer on 09.05.12.
+// Copyright (c) 2012 Christian Beer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface DTCoreText : NSObject
+
+@end
View
13 DTCoreText/DTCoreText.m
@@ -0,0 +1,13 @@
+//
+// DTCoreText.m
+// DTCoreText
+//
+// Created by Christian Beer on 09.05.12.
+// Copyright (c) 2012 Christian Beer. All rights reserved.
+//
+
+#import "DTCoreText.h"
+
+@implementation DTCoreText
+
+@end
View
2  DTCoreText/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
Please sign in to comment.
Something went wrong with that request. Please try again.