Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit 3be0828

Browse files
committed
Merge pull request #87 from wordpress-mobile/no-more-open-sans
No more open sans
2 parents 5abff61 + 7abe695 commit 3be0828

File tree

6 files changed

+69
-31
lines changed

6 files changed

+69
-31
lines changed

WordPress-iOS-Shared-Example/WordPress-iOS-Shared-Example/FontsTableViewController.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,13 @@ - (NSArray *)fontDetails {
9696
@{@"title": NSLocalizedString(@"OpenSans Light Italic",nil), @"font": [WPFontManager openSansLightItalicFontOfSize:FontSize]},
9797
@{@"title": NSLocalizedString(@"OpenSans Semi-Bold",nil), @"font": [WPFontManager openSansSemiBoldFontOfSize:FontSize]},
9898
@{@"title": NSLocalizedString(@"OpenSans Semi-Bold Italic",nil), @"font": [WPFontManager openSansSemiBoldItalicFontOfSize:FontSize]},
99-
99+
100+
@{@"title": NSLocalizedString(@"System",nil), @"font": [WPFontManager systemRegularFontOfSize:FontSize]},
101+
@{@"title": NSLocalizedString(@"System Bold",nil), @"font": [WPFontManager systemBoldFontOfSize:FontSize]},
102+
@{@"title": NSLocalizedString(@"System Italic",nil), @"font": [WPFontManager systemItalicFontOfSize:FontSize]},
103+
@{@"title": NSLocalizedString(@"System Light",nil), @"font": [WPFontManager systemLightFontOfSize:FontSize]},
104+
@{@"title": NSLocalizedString(@"System Semi-Bold",nil), @"font": [WPFontManager systemSemiBoldFontOfSize:FontSize]},
105+
100106
@{@"title": NSLocalizedString(@"Large Post Title Font", nil), @"font": [WPStyleGuide largePostTitleFont], @"attributes": [WPStyleGuide largePostTitleAttributes]},
101107
@{@"title": NSLocalizedString(@"Post Title Font", nil), @"font": [WPStyleGuide postTitleFont], @"attributes": [WPStyleGuide postTitleAttributes]},
102108
@{@"title": NSLocalizedString(@"Post Title Font Bold", nil), @"font": [WPStyleGuide postTitleFontBold], @"attributes": [WPStyleGuide postTitleAttributesBold]},

WordPress-iOS-Shared/Core/WPFontManager.h

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22

33
@interface WPFontManager : NSObject
44

5-
+ (UIFont *)openSansLightFontOfSize:(CGFloat)size;
6-
+ (UIFont *)openSansItalicFontOfSize:(CGFloat)size;
7-
+ (UIFont *)openSansLightItalicFontOfSize:(CGFloat)size;
8-
+ (UIFont *)openSansBoldFontOfSize:(CGFloat)size;
9-
+ (UIFont *)openSansBoldItalicFontOfSize:(CGFloat)size;
10-
+ (UIFont *)openSansSemiBoldFontOfSize:(CGFloat)size;
11-
+ (UIFont *)openSansSemiBoldItalicFontOfSize:(CGFloat)size;
12-
+ (UIFont *)openSansRegularFontOfSize:(CGFloat)size;
5+
+ (UIFont *)openSansLightFontOfSize:(CGFloat)size __deprecated_msg("Use systemLightFontOfSize instead");
6+
+ (UIFont *)openSansItalicFontOfSize:(CGFloat)size __deprecated_msg("Use systemItalicFontOfSize instead");
7+
+ (UIFont *)openSansLightItalicFontOfSize:(CGFloat)size __deprecated_msg("Use systemLightItalicFontOfSize instead");
8+
+ (UIFont *)openSansBoldFontOfSize:(CGFloat)size __deprecated_msg("Use systemBoldFontOfSize instead");
9+
+ (UIFont *)openSansBoldItalicFontOfSize:(CGFloat)size __deprecated_msg("Use systemBoldItalicFontOfSize instead");
10+
+ (UIFont *)openSansSemiBoldFontOfSize:(CGFloat)size __deprecated_msg("Use systemSemiBoldFontOfSize instead");
11+
+ (UIFont *)openSansSemiBoldItalicFontOfSize:(CGFloat)size __deprecated_msg("Use systemSemiBoldItalicFontOfSize instead");
12+
+ (UIFont *)openSansRegularFontOfSize:(CGFloat)size __deprecated_msg("Use systemRegularFontOfSize instead");
13+
14+
+ (UIFont *)systemLightFontOfSize:(CGFloat)size;
15+
+ (UIFont *)systemItalicFontOfSize:(CGFloat)size;
16+
+ (UIFont *)systemBoldFontOfSize:(CGFloat)size;
17+
+ (UIFont *)systemSemiBoldFontOfSize:(CGFloat)size;
18+
+ (UIFont *)systemRegularFontOfSize:(CGFloat)size;
1319

1420
+ (UIFont *)merriweatherBoldFontOfSize:(CGFloat)size;
1521
+ (UIFont *)merriweatherBoldItalicFontOfSize:(CGFloat)size;

WordPress-iOS-Shared/Core/WPFontManager.m

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,32 @@ + (UIFont *)openSansRegularFontOfSize:(CGFloat)size
6565
return [self fontNamed:fontName resourceName:resourceName fontType:FontTypeTTF size:size];
6666
}
6767

68+
#pragma mark - System Fonts
69+
70+
+ (UIFont *)systemLightFontOfSize:(CGFloat)size
71+
{
72+
return [UIFont systemFontOfSize:size weight:UIFontWeightLight];
73+
}
74+
75+
+ (UIFont *)systemItalicFontOfSize:(CGFloat)size
76+
{
77+
return [UIFont italicSystemFontOfSize:size];
78+
}
79+
80+
+ (UIFont *)systemBoldFontOfSize:(CGFloat)size
81+
{
82+
return [UIFont systemFontOfSize:size weight:UIFontWeightBold];
83+
}
84+
85+
+ (UIFont *)systemSemiBoldFontOfSize:(CGFloat)size
86+
{
87+
return [UIFont systemFontOfSize:size weight:UIFontWeightSemibold];
88+
}
89+
90+
+ (UIFont *)systemRegularFontOfSize:(CGFloat)size
91+
{
92+
return [UIFont systemFontOfSize:size weight:UIFontWeightRegular];
93+
}
6894

6995
#pragma mark - Merryweather Fonts
7096

WordPress-iOS-Shared/Core/WPNUXUtility.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,37 @@ @implementation WPNUXUtility
77

88
+ (UIFont *)textFieldFont
99
{
10-
return [WPFontManager openSansRegularFontOfSize:16.0];
10+
return [WPFontManager systemRegularFontOfSize:16.0];
1111
}
1212

1313
+ (UIFont *)descriptionTextFont
1414
{
15-
return [WPFontManager openSansRegularFontOfSize:15.0];
15+
return [WPFontManager systemRegularFontOfSize:15.0];
1616
}
1717

1818
+ (UIFont *)titleFont
1919
{
20-
return [WPFontManager openSansLightFontOfSize:24.0];
20+
return [WPFontManager systemLightFontOfSize:24.0];
2121
}
2222

2323
+ (UIFont *)swipeToContinueFont
2424
{
25-
return [WPFontManager openSansRegularFontOfSize:10.0];
25+
return [WPFontManager systemRegularFontOfSize:10.0];
2626
}
2727

2828
+ (UIFont *)tosLabelFont
2929
{
30-
return [WPFontManager openSansRegularFontOfSize:12.0];
30+
return [WPFontManager systemRegularFontOfSize:12.0];
3131
}
3232

3333
+ (UIFont *)tosLabelSmallerFont
3434
{
35-
return [WPFontManager openSansRegularFontOfSize:9.0];
35+
return [WPFontManager systemRegularFontOfSize:9.0];
3636
}
3737

3838
+ (UIFont *)confirmationLabelFont
3939
{
40-
return [WPFontManager openSansRegularFontOfSize:14.0];
40+
return [WPFontManager systemRegularFontOfSize:14.0];
4141
}
4242

4343
#pragma mark - Colors

WordPress-iOS-Shared/Core/WPNoResultsView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ - (instancetype)init {
4141

4242
// Message Label
4343
_messageLabel = [[UILabel alloc] init];
44-
_messageLabel.font = [WPFontManager openSansRegularFontOfSize:14.0];
44+
_messageLabel.font = [WPFontManager systemRegularFontOfSize:14.0];
4545
_messageLabel.textColor = [WPStyleGuide allTAllShadeGrey];
4646
_messageLabel.numberOfLines = 0;
4747
_messageLabel.textAlignment = NSTextAlignmentCenter;

WordPress-iOS-Shared/Core/WPStyleGuide.m

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ @implementation WPStyleGuide
99

1010
+ (UIFont *)largePostTitleFont
1111
{
12-
return [WPFontManager openSansLightFontOfSize:32.0];
12+
return [WPFontManager systemLightFontOfSize:32.0];
1313
}
1414

1515
+ (NSDictionary *)largePostTitleAttributes
@@ -22,12 +22,12 @@ + (NSDictionary *)largePostTitleAttributes
2222

2323
+ (UIFont *)postTitleFont
2424
{
25-
return [WPFontManager openSansRegularFontOfSize:16.0];
25+
return [WPFontManager systemRegularFontOfSize:16.0];
2626
}
2727

2828
+ (UIFont *)postTitleFontBold
2929
{
30-
return [WPFontManager openSansBoldFontOfSize:16.0];
30+
return [WPFontManager systemBoldFontOfSize:16.0];
3131
}
3232

3333
+ (NSDictionary *)postTitleAttributes
@@ -47,7 +47,7 @@ + (NSDictionary *)postTitleAttributesBold {
4747

4848
+ (UIFont *)subtitleFont
4949
{
50-
return [WPFontManager openSansRegularFontOfSize:12.0];
50+
return [WPFontManager systemRegularFontOfSize:12.0];
5151
}
5252

5353
+ (NSDictionary *)subtitleAttributes
@@ -60,7 +60,7 @@ + (NSDictionary *)subtitleAttributes
6060

6161
+ (UIFont *)subtitleFontItalic
6262
{
63-
return [WPFontManager openSansItalicFontOfSize:12.0];
63+
return [WPFontManager systemItalicFontOfSize:12.0];
6464
}
6565

6666
+ (NSDictionary *)subtitleItalicAttributes
@@ -73,7 +73,7 @@ + (NSDictionary *)subtitleItalicAttributes
7373

7474
+ (UIFont *)subtitleFontBold
7575
{
76-
return [WPFontManager openSansBoldFontOfSize:12.0];
76+
return [WPFontManager systemBoldFontOfSize:12.0];
7777
}
7878

7979
+ (NSDictionary *)subtitleAttributesBold
@@ -86,12 +86,12 @@ + (NSDictionary *)subtitleAttributesBold
8686

8787
+ (UIFont *)labelFont
8888
{
89-
return [WPFontManager openSansBoldFontOfSize:10.0];
89+
return [WPFontManager systemBoldFontOfSize:10.0];
9090
}
9191

9292
+ (UIFont *)labelFontNormal
9393
{
94-
return [WPFontManager openSansRegularFontOfSize:10.0];
94+
return [WPFontManager systemRegularFontOfSize:10.0];
9595
}
9696

9797
+ (NSDictionary *)labelAttributes
@@ -104,17 +104,17 @@ + (NSDictionary *)labelAttributes
104104

105105
+ (UIFont *)regularTextFont
106106
{
107-
return [WPFontManager openSansRegularFontOfSize:16.0];
107+
return [WPFontManager systemRegularFontOfSize:16.0];
108108
}
109109

110110
+ (UIFont *)regularTextFontSemiBold
111111
{
112-
return [WPFontManager openSansSemiBoldFontOfSize:16.0];
112+
return [WPFontManager systemSemiBoldFontOfSize:16.0];
113113
}
114114

115115
+ (UIFont *)regularTextFontBold
116116
{
117-
return [WPFontManager openSansBoldFontOfSize:16.0];
117+
return [WPFontManager systemBoldFontOfSize:16.0];
118118
}
119119

120120
+ (NSDictionary *)regularTextAttributes
@@ -127,17 +127,17 @@ + (NSDictionary *)regularTextAttributes
127127

128128
+ (UIFont *)tableviewTextFont
129129
{
130-
return [WPFontManager openSansRegularFontOfSize:17.0];
130+
return [WPFontManager systemRegularFontOfSize:17.0];
131131
}
132132

133133
+ (UIFont *)tableviewSubtitleFont
134134
{
135-
return [WPFontManager openSansRegularFontOfSize:17.0];
135+
return [WPFontManager systemRegularFontOfSize:17.0];
136136
}
137137

138138
+ (UIFont *)tableviewSectionHeaderFont
139139
{
140-
return [WPFontManager openSansRegularFontOfSize:13.0];
140+
return [WPFontManager systemRegularFontOfSize:13.0];
141141
}
142142

143143

0 commit comments

Comments
 (0)