Skip to content

Commit

Permalink
Merge pull request #115 from wordpress-mobile/feature/noto
Browse files Browse the repository at this point in the history
Replace Merriweather with Noto Serif
  • Loading branch information
koke authored Feb 17, 2017
2 parents ccd24c8 + 0019379 commit 96c7490
Show file tree
Hide file tree
Showing 22 changed files with 34 additions and 160 deletions.
4 changes: 2 additions & 2 deletions WordPress-iOS-Shared-Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PODS:
- CocoaLumberjack/Core
- CocoaLumberjack/Extensions (2.2.0):
- CocoaLumberjack/Default
- WordPress-iOS-Shared (0.7.1):
- WordPress-iOS-Shared (0.7.2):
- CocoaLumberjack (~> 2.2.0)

DEPENDENCIES:
Expand All @@ -19,7 +19,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
CocoaLumberjack: 17fe8581f84914d5d7e6360f7c70022b173c3ae0
WordPress-iOS-Shared: 30e179fda968f8eb023761cc99382b6a511b6f04
WordPress-iOS-Shared: c989e2760e64736dd5de10b932bb4fccdd9f9695

PODFILE CHECKSUM: 8196d0bef0b4757ec5d593c176fec8a0ebac8e4f

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,29 +82,22 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

- (NSArray *)fontDetails {
return @[
@{@"title": NSLocalizedString(@"Merriweather",nil), @"font": [WPFontManager merriweatherRegularFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"Merriweather Bold",nil), @"font": [WPFontManager merriweatherBoldFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"Merriweather Bold Italic",nil), @"font": [WPFontManager merriweatherBoldItalicFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"Merriweather Italic",nil), @"font": [WPFontManager merriweatherItalicFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"Merriweather Light",nil), @"font": [WPFontManager merriweatherLightFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"Merriweather Italic",nil), @"font": [WPFontManager merriweatherLightItalicFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"Noto Serif",nil), @"font": [WPFontManager notoRegularFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"Noto Serif Bold",nil), @"font": [WPFontManager notoBoldFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"Noto Serif Bold Italic",nil), @"font": [WPFontManager notoBoldItalicFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"Noto Serif Italic",nil), @"font": [WPFontManager notoItalicFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"System",nil), @"font": [WPFontManager systemRegularFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"System Bold",nil), @"font": [WPFontManager systemBoldFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"System Italic",nil), @"font": [WPFontManager systemItalicFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"System Light",nil), @"font": [WPFontManager systemLightFontOfSize:FontSize]},
@{@"title": NSLocalizedString(@"System Semi-Bold",nil), @"font": [WPFontManager systemSemiBoldFontOfSize:FontSize]},

@{@"title": NSLocalizedString(@"Large Post Title Font", nil), @"font": [WPStyleGuide largePostTitleFont], @"attributes": [WPStyleGuide largePostTitleAttributes]},
@{@"title": NSLocalizedString(@"Post Title Font", nil), @"font": [WPStyleGuide postTitleFont], @"attributes": [WPStyleGuide postTitleAttributes]},
@{@"title": NSLocalizedString(@"Post Title Font Bold", nil), @"font": [WPStyleGuide postTitleFontBold], @"attributes": [WPStyleGuide postTitleAttributesBold]},
@{@"title": NSLocalizedString(@"Post Title Font", nil), @"font": [WPStyleGuide postTitleFont], @"attributes": [WPStyleGuide postTitleAttributes]},
@{@"title": NSLocalizedString(@"Subtitle Font", nil), @"font": [WPStyleGuide subtitleFont], @"attributes": [WPStyleGuide subtitleAttributes]},
@{@"title": NSLocalizedString(@"Subtitle Font Italic", nil), @"font": [WPStyleGuide subtitleFontItalic], @"attributes": [WPStyleGuide subtitleItalicAttributes]},
@{@"title": NSLocalizedString(@"Subtitle Font Bold", nil), @"font": [WPStyleGuide subtitleFontBold], @"attributes": [WPStyleGuide subtitleAttributesBold]},
@{@"title": NSLocalizedString(@"Label Font", nil), @"font": [WPStyleGuide labelFont], @"attributes": [WPStyleGuide labelAttributes]},
@{@"title": NSLocalizedString(@"Label Font Normal", nil), @"font": [WPStyleGuide labelFontNormal], @"attributes": [WPStyleGuide labelAttributes]},
@{@"title": NSLocalizedString(@"Regular Text Font", nil), @"font": [WPStyleGuide regularTextFont], @"attributes": [WPStyleGuide regularTextAttributes]},
@{@"title": NSLocalizedString(@"Regular Text Font Bold", nil), @"font": [WPStyleGuide regularTextFontBold], @"attributes": [WPStyleGuide regularTextAttributes]},
@{@"title": NSLocalizedString(@"Regular Text Font Semibold", nil), @"font": [WPStyleGuide regularTextFontSemiBold], @"attributes": [WPStyleGuide regularTextAttributes]},
@{@"title": NSLocalizedString(@"Tableview Text Font", nil), @"font": [WPStyleGuide tableviewTextFont], @"attributes": [NSNull null]},
@{@"title": NSLocalizedString(@"Tableview Subtitle Font", nil), @"font": [WPStyleGuide tableviewSubtitleFont], @"attributes": [NSNull null]},
Expand Down
Binary file removed WordPress-iOS-Shared/Assets/Merriweather-Bold.ttf
Binary file not shown.
Binary file not shown.
Binary file removed WordPress-iOS-Shared/Assets/Merriweather-Italic.ttf
Binary file not shown.
Binary file removed WordPress-iOS-Shared/Assets/Merriweather-Light.ttf
Binary file not shown.
Binary file not shown.
Binary file removed WordPress-iOS-Shared/Assets/Merriweather-Regular.ttf
Binary file not shown.
Binary file added WordPress-iOS-Shared/Assets/NotoSerif-Bold.ttf
Binary file not shown.
Binary file not shown.
Binary file added WordPress-iOS-Shared/Assets/NotoSerif-Italic.ttf
Binary file not shown.
Binary file not shown.
Binary file removed WordPress-iOS-Shared/Assets/OpenSans-Bold.ttf
Binary file not shown.
Binary file removed WordPress-iOS-Shared/Assets/OpenSans-BoldItalic.ttf
Binary file not shown.
Binary file removed WordPress-iOS-Shared/Assets/OpenSans-Italic.ttf
Binary file not shown.
Binary file removed WordPress-iOS-Shared/Assets/OpenSans-Light.ttf
Binary file not shown.
Binary file not shown.
Binary file removed WordPress-iOS-Shared/Assets/OpenSans-Regular.ttf
Binary file not shown.
Binary file removed WordPress-iOS-Shared/Assets/OpenSans-Semibold.ttf
Binary file not shown.
Binary file not shown.
27 changes: 6 additions & 21 deletions WordPress-iOS-Shared/Core/WPFontManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,20 @@ NS_ASSUME_NONNULL_BEGIN

@interface WPFontManager : NSObject

/// Loads the OpenSans font family for the life of the current process.
/// This effectively makes it possible to look this font up using font descriptors.
///
+ (void)loadOpenSansFontFamily;
+ (UIFont *)openSansLightFontOfSize:(CGFloat)size __deprecated_msg("Use systemLightFontOfSize instead");
+ (UIFont *)openSansItalicFontOfSize:(CGFloat)size __deprecated_msg("Use systemItalicFontOfSize instead");
+ (UIFont *)openSansLightItalicFontOfSize:(CGFloat)size __deprecated_msg("Use systemLightItalicFontOfSize instead");
+ (UIFont *)openSansBoldFontOfSize:(CGFloat)size __deprecated_msg("Use systemBoldFontOfSize instead");
+ (UIFont *)openSansBoldItalicFontOfSize:(CGFloat)size __deprecated_msg("Use systemBoldItalicFontOfSize instead");
+ (UIFont *)openSansSemiBoldFontOfSize:(CGFloat)size __deprecated_msg("Use systemSemiBoldFontOfSize instead");
+ (UIFont *)openSansSemiBoldItalicFontOfSize:(CGFloat)size __deprecated_msg("Use systemSemiBoldItalicFontOfSize instead");
+ (UIFont *)openSansRegularFontOfSize:(CGFloat)size __deprecated_msg("Use systemRegularFontOfSize instead");

+ (UIFont *)systemLightFontOfSize:(CGFloat)size;
+ (UIFont *)systemItalicFontOfSize:(CGFloat)size;
+ (UIFont *)systemBoldFontOfSize:(CGFloat)size;
+ (UIFont *)systemSemiBoldFontOfSize:(CGFloat)size;
+ (UIFont *)systemRegularFontOfSize:(CGFloat)size;

/// Loads the Merriwheather font family for the life of the current process.
/// Loads the Noto font family for the life of the current process.
/// This effectively makes it possible to look this font up using font descriptors.
///
+ (void)loadMerriweatherFontFamily;
+ (UIFont *)merriweatherBoldFontOfSize:(CGFloat)size;
+ (UIFont *)merriweatherBoldItalicFontOfSize:(CGFloat)size;
+ (UIFont *)merriweatherItalicFontOfSize:(CGFloat)size;
+ (UIFont *)merriweatherLightFontOfSize:(CGFloat)size;
+ (UIFont *)merriweatherLightItalicFontOfSize:(CGFloat)size;
+ (UIFont *)merriweatherRegularFontOfSize:(CGFloat)size;
+ (void)loadNotoFontFamily;
+ (UIFont *)notoBoldFontOfSize:(CGFloat)size;
+ (UIFont *)notoBoldItalicFontOfSize:(CGFloat)size;
+ (UIFont *)notoItalicFontOfSize:(CGFloat)size;
+ (UIFont *)notoRegularFontOfSize:(CGFloat)size;

@end

Expand Down
148 changes: 22 additions & 126 deletions WordPress-iOS-Shared/Core/WPFontManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,88 +8,6 @@ @implementation WPFontManager
static NSString * const FontTypeTTF = @"ttf";
static NSString * const FontTypeOTF = @"otf";

#pragma mark - Open Sans Fonts

static NSString* const OpenSansLightFontName = @"OpenSans-Light";
static NSString* const OpenSansItalicFontName = @"OpenSans-Italic";
static NSString* const OpenSansLightItalicFontName = @"OpenSans-LightItalic";
static NSString* const OpenSansBoldFontName = @"OpenSans-Bold";
static NSString* const OpenSansBoldItalicFontName = @"OpenSans-BoldItalic";
static NSString* const OpenSansSemiBoldFontName = @"OpenSans-Semibold";
static NSString* const OpenSansSemiboldItalicFontName = @"OpenSans-SemiboldItalic";
static NSString* const OpenSansRegularFontName = @"OpenSans-Regular";

/// Loads the OpenSans font family for the life of the current process.
/// This effectively makes it possible to look this font up using font descriptors.
///
+ (void)loadOpenSansFontFamily
{
[self loadFontResourceNamed:OpenSansLightFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:OpenSansItalicFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:OpenSansLightItalicFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:OpenSansBoldFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:OpenSansBoldItalicFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:OpenSansSemiBoldFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:OpenSansSemiboldItalicFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:OpenSansRegularFontName withExtension:FontTypeTTF];
}

+ (UIFont *)openSansLightFontOfSize:(CGFloat)size
{
NSString *resourceName = @"OpenSans-Light";
NSString *fontName = @"OpenSans-Light";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
}

+ (UIFont *)openSansItalicFontOfSize:(CGFloat)size
{
NSString *resourceName = @"OpenSans-Italic";
NSString *fontName = @"OpenSans-Italic";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
}

+ (UIFont *)openSansLightItalicFontOfSize:(CGFloat)size
{
NSString *resourceName = @"OpenSans-LightItalic";
NSString *fontName = @"OpenSans-LightItalic";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
}

+ (UIFont *)openSansBoldFontOfSize:(CGFloat)size
{
NSString *resourceName = @"OpenSans-Bold";
NSString *fontName = @"OpenSans-Bold";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
}

+ (UIFont *)openSansBoldItalicFontOfSize:(CGFloat)size
{
NSString *resourceName = @"OpenSans-BoldItalic";
NSString *fontName = @"OpenSans-BoldItalic";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
}

+ (UIFont *)openSansSemiBoldFontOfSize:(CGFloat)size
{
NSString *resourceName = @"OpenSans-Semibold";
NSString *fontName = @"OpenSans-Semibold";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
}

+ (UIFont *)openSansSemiBoldItalicFontOfSize:(CGFloat)size
{
NSString *resourceName = @"OpenSans-SemiboldItalic";
NSString *fontName = @"OpenSans-SemiboldItalic";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
}

+ (UIFont *)openSansRegularFontOfSize:(CGFloat)size
{
NSString *resourceName = @"OpenSans-Regular";
NSString *fontName = @"OpenSans";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
}

#pragma mark - System Fonts

+ (UIFont *)systemLightFontOfSize:(CGFloat)size
Expand Down Expand Up @@ -117,65 +35,43 @@ + (UIFont *)systemRegularFontOfSize:(CGFloat)size
return [UIFont systemFontOfSize:size weight:UIFontWeightRegular];
}

#pragma mark - Merryweather Fonts

static NSString* const MerriweatherBoldFontName = @"Merriweather-Bold";
static NSString* const MerriweatherBoldItalicFontName = @"Merriweather-BoldItalic";
static NSString* const MerriweatherItalicFontName = @"Merriweather-Italic";
static NSString* const MerriweatherLightFontName = @"Merriweather-Light";
static NSString* const MerriweatherLightItalicFontName = @"Merriweather-LightItalic";
static NSString* const MerriweatherRegularFontName = @"Merriweather-Regular";

+ (void)loadMerriweatherFontFamily
{
[self loadFontResourceNamed:MerriweatherBoldFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:MerriweatherBoldItalicFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:MerriweatherItalicFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:MerriweatherLightFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:MerriweatherLightItalicFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:MerriweatherRegularFontName withExtension:FontTypeTTF];
}
#pragma mark - Noto Fonts

+ (UIFont *)merriweatherBoldFontOfSize:(CGFloat)size
{
NSString *resourceName = @"Merriweather-Bold";
NSString *fontName = @"Merriweather-Bold";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
}
static NSString* const NotoBoldFontName = @"NotoSerif-Bold";
static NSString* const NotoBoldFileName = @"NotoSerif-Bold";
static NSString* const NotoBoldItalicFontName = @"NotoSerif-BoldItalic";
static NSString* const NotoBoldItalicFileName = @"NotoSerif-BoldItalic";
static NSString* const NotoItalicFontName = @"NotoSerif-Italic";
static NSString* const NotoItalicFileName = @"NotoSerif-Italic";
static NSString* const NotoRegularFontName = @"NotoSerif";
static NSString* const NotoRegularFileName = @"NotoSerif-Regular";

+ (UIFont *)merriweatherBoldItalicFontOfSize:(CGFloat)size;
+ (void)loadNotoFontFamily
{
NSString *resourceName = @"Merriweather-BoldItalic";
NSString *fontName = @"Merriweather-BoldItalic";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
[self loadFontResourceNamed:NotoBoldFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:NotoBoldItalicFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:NotoItalicFontName withExtension:FontTypeTTF];
[self loadFontResourceNamed:NotoRegularFontName withExtension:FontTypeTTF];
}

+ (UIFont *)merriweatherItalicFontOfSize:(CGFloat)size;
+ (UIFont *)notoBoldFontOfSize:(CGFloat)size
{
NSString *resourceName = @"Merriweather-Italic";
NSString *fontName = @"Merriweather-Italic";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
return [self fontNamed:NotoBoldFontName resourceName:NotoBoldFileName fontType:FontTypeTTF size:size];
}

+ (UIFont *)merriweatherLightFontOfSize:(CGFloat)size;
+ (UIFont *)notoBoldItalicFontOfSize:(CGFloat)size;
{
NSString *resourceName = @"Merriweather-Light";
NSString *fontName = @"Merriweather-Light";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
return [self fontNamed:NotoBoldItalicFontName resourceName:NotoBoldItalicFileName fontType:FontTypeTTF size:size];
}

+ (UIFont *)merriweatherLightItalicFontOfSize:(CGFloat)size
+ (UIFont *)notoItalicFontOfSize:(CGFloat)size;
{
NSString *resourceName = @"Merriweather-LightItalic";
NSString *fontName = @"Merriweather-LightItalic";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
return [self fontNamed:NotoItalicFontName resourceName:NotoItalicFileName fontType:FontTypeTTF size:size];
}

+ (UIFont *)merriweatherRegularFontOfSize:(CGFloat)size
+ (UIFont *)notoRegularFontOfSize:(CGFloat)size
{
NSString *resourceName = @"Merriweather-Regular";
NSString *fontName = @"Merriweather";
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
return [self fontNamed:NotoRegularFontName resourceName:NotoRegularFileName fontType:FontTypeTTF size:size];
}


Expand Down

0 comments on commit 96c7490

Please sign in to comment.