Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added DTDefaultFontName option

  • Loading branch information...
commit 6832ecd21ef34173f2153b8ea15e9695843c64e6 1 parent 1b7fa62
@stuartcarnie authored
View
1  Classes/NSAttributedString+HTML.h
@@ -14,6 +14,7 @@ extern NSString *NSTextSizeMultiplierDocumentOption;
extern NSString *DTMaxImageSize;
extern NSString *DTDefaultFontFamily;
+extern NSString *DTDefaultFontName;
extern NSString *DTDefaultTextColor;
extern NSString *DTDefaultLinkColor;
extern NSString *DTDefaultLinkDecoration;
View
6 Classes/NSAttributedString+HTML.m
@@ -33,6 +33,7 @@
// custom options
NSString *DTMaxImageSize = @"DTMaxImageSize";
NSString *DTDefaultFontFamily = @"DTDefaultFontFamily";
+NSString *DTDefaultFontName = @"DTDefaultFontName";
NSString *DTDefaultTextColor = @"DTDefaultTextColor";
NSString *DTDefaultLinkColor = @"DTDefaultLinkColor";
NSString *DTDefaultLinkDecoration = @"DTDefaultLinkDecoration";
@@ -117,6 +118,11 @@ - (id)initWithHTML:(NSData *)data options:(NSDictionary *)options documentAttrib
defaultFontDescriptor.fontFamily = @"Times New Roman";
}
+ NSString *defaultFontName = [options objectForKey:DTDefaultFontName];
+ if (defaultFontName) {
+ defaultFontDescriptor.fontName = defaultFontName;
+ }
+
id defaultLinkColor = [options objectForKey:DTDefaultLinkColor];
if (defaultLinkColor)
Please sign in to comment.
Something went wrong with that request. Please try again.