diff --git a/iphone/Common/RichTextVC.m b/iphone/Common/RichTextVC.m index 016ff41678..5a8a7a0df9 100644 --- a/iphone/Common/RichTextVC.m +++ b/iphone/Common/RichTextVC.m @@ -1,5 +1,6 @@ #import "RichTextVC.h" +#import "UIFont+MapsMeFonts.h" @interface RichTextVC () @@ -36,7 +37,7 @@ _textView.editable = NO; if ([_textView respondsToSelector:@selector(setTextContainerInset:)]) _textView.textContainerInset = UIEdgeInsetsMake(10, 5, 10, 5); - _textView.font = [UIFont fontWithName:@"HelveticaNeue" size:16]; + _textView.font = [UIFont regular16]; _textView.dataDetectorTypes = UIDataDetectorTypeLink; } return _textView; diff --git a/iphone/Maps/Classes/BadgeView.m b/iphone/Maps/Classes/BadgeView.m index eec1bdf9c3..e6f41d4ee3 100644 --- a/iphone/Maps/Classes/BadgeView.m +++ b/iphone/Maps/Classes/BadgeView.m @@ -1,6 +1,7 @@ #import "BadgeView.h" #import "UIKitCategories.h" +#import "UIFont+MapsMeFonts.h" @implementation BadgeView @@ -9,7 +10,7 @@ [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; self.hidden = value == 0; - UIFont * font = [UIFont fontWithName:@"HelveticaNeue-Light" size:12]; + UIFont * font = [UIFont regular10]; UIImage * image = [UIImage imageNamed:@"Badge"]; CGFloat const textWidth = [@(value).stringValue sizeWithDrawSize:CGSizeMake(100, 20) font:font].width; CGFloat const offset = 4; diff --git a/iphone/Maps/Classes/MWMDirectionView.mm b/iphone/Maps/Classes/MWMDirectionView.mm index 2542c61e58..33cb654194 100644 --- a/iphone/Maps/Classes/MWMDirectionView.mm +++ b/iphone/Maps/Classes/MWMDirectionView.mm @@ -8,6 +8,7 @@ #import "MWMDirectionView.h" #import "MWMPlacePageViewManager.h" +#import "UIFont+MapsMeFonts.h" #import "UIKitCategories.h" static NSString * const kDirectionViewNibName = @"MWMDirectionView"; @@ -37,7 +38,7 @@ static CGFloat const kDirectionArrowSide = IPAD ? 260. : 160.; NSString * const kFontName = @"HelveticaNeue"; self.titleLabel.font = self.distanceLabel.font = IPAD ? [UIFont fontWithName:kFontName size:52.] : [UIFont fontWithName:kFontName size:32.]; - self.typeLabel.font = IPAD ? [UIFont fontWithName:kFontName size:24.] : [UIFont fontWithName:kFontName size:16.]; + self.typeLabel.font = IPAD ? [UIFont regular24] : [UIFont regular16]; self.autoresizingMask = self.contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; self.directionArrow.autoresizingMask = UIViewAutoresizingNone; diff --git a/iphone/Maps/Classes/MWMPlacePageInfoCell.mm b/iphone/Maps/Classes/MWMPlacePageInfoCell.mm index b6d6477378..b035806977 100644 --- a/iphone/Maps/Classes/MWMPlacePageInfoCell.mm +++ b/iphone/Maps/Classes/MWMPlacePageInfoCell.mm @@ -6,12 +6,13 @@ // Copyright (c) 2015 MapsWithMe. All rights reserved. // -#import "MWMPlacePageInfoCell.h" -#import "UIKitCategories.h" #import "MWMPlacePageEntity.h" +#import "MWMPlacePageInfoCell.h" +#import "UIFont+MapsMeFonts.h" +#import "UIKitCategories.h" -#include "../../../platform/settings.hpp" -#include "../../../platform/measurement_utils.hpp" +#include "platform/settings.hpp" +#include "platform/measurement_utils.hpp" extern NSString * const kUserDefaultsLatLonAsDMSKey; @@ -64,7 +65,7 @@ extern NSString * const kUserDefaultsLatLonAsDMSKey; self.icon.image = image; if ([self.textContainer isKindOfClass:[UITextView class]]) - [self.textContainer setAttributedText:[[NSAttributedString alloc] initWithString:info attributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Light" size:16.]}]]; + [self.textContainer setAttributedText:[[NSAttributedString alloc] initWithString:info attributes:@{NSFontAttributeName : [UIFont light16]}]]; else [self.textContainer setText:info]; diff --git a/iphone/Maps/Classes/MapCell.mm b/iphone/Maps/Classes/MapCell.mm index a717f03dc0..5c33e11396 100644 --- a/iphone/Maps/Classes/MapCell.mm +++ b/iphone/Maps/Classes/MapCell.mm @@ -1,6 +1,8 @@ #import "Common.h" #import "MapCell.h" #import "UIKitCategories.h" +#import "UIColor+MapsMeColor.h" +#import "UIFont+MapsMeFonts.h" @interface MapCell () @@ -267,7 +269,7 @@ _titleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _titleLabel.backgroundColor = [UIColor clearColor]; _titleLabel.textColor = [UIColor blackColor]; - _titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:17]; + _titleLabel.font = [UIFont regular17]; } return _titleLabel; } @@ -278,7 +280,7 @@ { _subtitleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _subtitleLabel.backgroundColor = [UIColor clearColor]; - _subtitleLabel.textColor = [UIColor colorWithColorCode:@"999999"]; + _subtitleLabel.textColor = [UIColor blackSecondaryText]; _subtitleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:13]; } return _subtitleLabel; diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index 6111ef6e40..be89d76d0d 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -10,6 +10,7 @@ #import "RouteState.h" #import "RouteView.h" #import "ShareActionSheet.h" +#import "UIFont+MapsMeFonts.h" #import "UIKitCategories.h" #import "UIViewController+Navigation.h" @@ -833,7 +834,7 @@ typedef NS_OPTIONS(NSUInteger, MapInfoView) [clearButton setTitle:L(@"clear") forState:UIControlStateNormal]; [clearButton addTarget:self action:@selector(clearApiMode:) forControlEvents:UIControlEventTouchUpInside]; clearButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin; - clearButton.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:17]; + clearButton.titleLabel.font = [UIFont light17]; [_apiBar addSubview:clearButton]; [_apiBar addSubview:self.apiTitleLabel]; @@ -853,7 +854,7 @@ typedef NS_OPTIONS(NSUInteger, MapInfoView) if (!_apiTitleLabel) { _apiTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 240, 26)]; - _apiTitleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:17]; + _apiTitleLabel.font = [UIFont light17]; _apiTitleLabel.textColor = [UIColor whiteColor]; _apiTitleLabel.textAlignment = NSTextAlignmentCenter; _apiTitleLabel.alpha = 0.5; diff --git a/iphone/Maps/Classes/NextTurnPhoneView.m b/iphone/Maps/Classes/NextTurnPhoneView.m index 81fe1af1e3..4b9d5a9a2f 100644 --- a/iphone/Maps/Classes/NextTurnPhoneView.m +++ b/iphone/Maps/Classes/NextTurnPhoneView.m @@ -7,6 +7,7 @@ // #import "NextTurnPhoneView.h" +#import "UIFont+MapsMeFonts.h" #import "UIKitCategories.h" @implementation NextTurnPhoneView @@ -129,7 +130,7 @@ { _metricsLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _metricsLabel.backgroundColor = [UIColor clearColor]; - _metricsLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:14]; + _metricsLabel.font = [UIFont regular14]; _metricsLabel.textColor = [UIColor colorWithColorCode:@"2291D1"]; } return _metricsLabel; diff --git a/iphone/Maps/Classes/RouteOverallInfoView.m b/iphone/Maps/Classes/RouteOverallInfoView.m index bb168e08ae..ebd68654fa 100644 --- a/iphone/Maps/Classes/RouteOverallInfoView.m +++ b/iphone/Maps/Classes/RouteOverallInfoView.m @@ -7,8 +7,9 @@ // #import "RouteOverallInfoView.h" -#import "UIKitCategories.h" #import "TimeUtils.h" +#import "UIFont+MapsMeFonts.h" +#import "UIKitCategories.h" @implementation RouteOverallInfoView @@ -81,7 +82,7 @@ { _timeLeftLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _timeLeftLabel.backgroundColor = [UIColor clearColor]; - _timeLeftLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:14]; + _timeLeftLabel.font = [UIFont regular14]; _timeLeftLabel.textColor = [UIColor colorWithColorCode:@"565656"]; } return _timeLeftLabel; diff --git a/iphone/Maps/Classes/SearchBar.mm b/iphone/Maps/Classes/SearchBar.mm index 18c6b5498b..dc348f35d4 100644 --- a/iphone/Maps/Classes/SearchBar.mm +++ b/iphone/Maps/Classes/SearchBar.mm @@ -1,9 +1,9 @@ - -#import "SearchBar.h" #import "Framework.h" +#import "SearchBar.h" #import "UIColor+MapsMeColor.h" +#import "UIFont+MapsMeFonts.h" -#import "../../../3party/Alohalytics/src/alohalytics_objc.h" +#import "3party/Alohalytics/src/alohalytics_objc.h" @interface SearchBar () @@ -125,7 +125,7 @@ extern NSString * const kAlohalyticsTapEventKey; { _textField = [[UITextField alloc] initWithFrame:CGRectMake(1, 0, self.width, 22)]; _textField.autoresizingMask = UIViewAutoresizingFlexibleWidth; - _textField.font = [UIFont fontWithName:@"HelveticaNeue" size:16.]; + _textField.font = [UIFont regular16]; _textField.textColor = [UIColor blackPrimaryText]; _textField.placeholder = L(@"search"); _textField.returnKeyType = UIReturnKeySearch; diff --git a/iphone/Maps/Classes/SearchCategoryCell.m b/iphone/Maps/Classes/SearchCategoryCell.m index f2fb296ff5..81ecbbb031 100644 --- a/iphone/Maps/Classes/SearchCategoryCell.m +++ b/iphone/Maps/Classes/SearchCategoryCell.m @@ -1,7 +1,8 @@ #import "SearchCategoryCell.h" -#import "UIKitCategories.h" #import "UIColor+MapsMeColor.h" +#import "UIFont+MapsMeFonts.h" +#import "UIKitCategories.h" @interface SearchCategoryCell () @@ -49,7 +50,7 @@ _titleLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; _titleLabel.backgroundColor = [UIColor clearColor]; _titleLabel.textColor = [UIColor blackPrimaryText]; - _titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:16.]; + _titleLabel.font = [UIFont regular16]; } return _titleLabel; } diff --git a/iphone/Maps/Classes/SearchResultCell.m b/iphone/Maps/Classes/SearchResultCell.m index d15f095c2b..a36c4620f3 100644 --- a/iphone/Maps/Classes/SearchResultCell.m +++ b/iphone/Maps/Classes/SearchResultCell.m @@ -1,7 +1,8 @@ #import "SearchResultCell.h" -#import "UIKitCategories.h" #import "UIColor+MapsMeColor.h" +#import "UIFont+MapsMeFonts.h" +#import "UIKitCategories.h" static CGFloat const kOffset = 16.; @@ -28,11 +29,11 @@ static CGFloat const kOffset = 16.; return self; } -#define DISTANCE_FONT [UIFont fontWithName:@"HelveticaNeue" size:14] -#define TYPE_FONT [UIFont fontWithName:@"HelveticaNeue-Light" size:12] -#define TITLE_FONT [UIFont fontWithName:@"HelveticaNeue" size:16] -#define TITLE_BOLD_FONT [UIFont fontWithName:@"HelveticaNeue-Bold" size:16] -#define SUBTITLE_FONT [UIFont fontWithName:@"HelveticaNeue-Light" size:12] +#define DISTANCE_FONT [UIFont regular14] +#define TYPE_FONT [UIFont light12] +#define TITLE_FONT [UIFont regular16] +#define TITLE_BOLD_FONT [UIFont bold16] +#define SUBTITLE_FONT [UIFont light12] #define SPACE 4 - (void)setTitle:(NSString *)title selectedRanges:(NSArray *)selectedRanges diff --git a/iphone/Maps/Classes/SearchShowOnMapCell.m b/iphone/Maps/Classes/SearchShowOnMapCell.m index d81f21967f..9a0d0a601e 100644 --- a/iphone/Maps/Classes/SearchShowOnMapCell.m +++ b/iphone/Maps/Classes/SearchShowOnMapCell.m @@ -1,7 +1,8 @@ #import "SearchShowOnMapCell.h" -#import "UIKitCategories.h" #import "UIColor+MapsMeColor.h" +#import "UIFont+MapsMeFonts.h" +#import "UIKitCategories.h" static CGFloat const kOffset = 16.; @@ -45,7 +46,7 @@ static CGFloat const kOffset = 16.; _titleLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; _titleLabel.backgroundColor = [UIColor clearColor]; _titleLabel.textColor = [UIColor primary]; - _titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:16.]; + _titleLabel.font = [UIFont regular16]; } return _titleLabel; } diff --git a/iphone/Maps/Classes/SearchSuggestCell.m b/iphone/Maps/Classes/SearchSuggestCell.m index d826570108..ae2e21f4a3 100644 --- a/iphone/Maps/Classes/SearchSuggestCell.m +++ b/iphone/Maps/Classes/SearchSuggestCell.m @@ -1,7 +1,8 @@ #import "SearchSuggestCell.h" -#import "UIKitCategories.h" #import "UIColor+MapsMeColor.h" +#import "UIFont+MapsMeFonts.h" +#import "UIKitCategories.h" @interface SearchSuggestCell () @@ -49,7 +50,7 @@ _titleLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; _titleLabel.backgroundColor = [UIColor clearColor]; _titleLabel.textColor = [UIColor primary]; - _titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:16.]; + _titleLabel.font = [UIFont regular16]; } return _titleLabel; } diff --git a/iphone/Maps/Classes/SearchView.mm b/iphone/Maps/Classes/SearchView.mm index 683d1a93b9..25f8c4963e 100644 --- a/iphone/Maps/Classes/SearchView.mm +++ b/iphone/Maps/Classes/SearchView.mm @@ -1,4 +1,5 @@ #import "Common.h" +#import "Framework.h" #import "LocationManager.h" #import "LocationManager.h" #import "MapsAppDelegate.h" @@ -11,22 +12,21 @@ #import "SearchView.h" #import "Statistics.h" #import "ToastView.h" -#import "UIKitCategories.h" #import "UIColor+MapsMeColor.h" +#import "UIFont+MapsMeFonts.h" +#import "UIKitCategories.h" -#include "Framework.h" +#include "geometry/angles.hpp" +#include "geometry/distance_on_sphere.hpp" -#include "../../search/result.hpp" -#include "../../search/params.hpp" +#include "indexer/mercator.hpp" -#include "../../indexer/mercator.hpp" +#include "platform/platform.hpp" +#include "platform/preferred_languages.hpp" +#include "platform/settings.hpp" -#include "../../platform/platform.hpp" -#include "../../platform/preferred_languages.hpp" -#include "../../platform/settings.hpp" - -#include "../../geometry/angles.hpp" -#include "../../geometry/distance_on_sphere.hpp" +#include "search/params.hpp" +#include "search/result.hpp" @interface SearchResultsWrapper : NSObject @@ -779,7 +779,7 @@ static BOOL keyboardLoaded = NO; { _emptyResultLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.width, 60)]; _emptyResultLabel.backgroundColor = [UIColor clearColor]; - _emptyResultLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:16]; + _emptyResultLabel.font = [UIFont regular16]; _emptyResultLabel.text = L(@"no_search_results_found"); _emptyResultLabel.textColor = [UIColor primary]; _emptyResultLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth; diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 15ddc7f04c..e7b743eabc 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -34,6 +34,7 @@ 347274771B0F4F3900756B37 /* me.maps.watchkitextension.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = 347274761B0F4F3900756B37 /* me.maps.watchkitextension.entitlements */; }; 347274791B0F4FD900756B37 /* me.maps.watchkitextension.production.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = 347274781B0F4FD900756B37 /* me.maps.watchkitextension.production.entitlements */; }; 3472747B1B0F4FF100756B37 /* me.maps.production.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = 3472747A1B0F4FF100756B37 /* me.maps.production.entitlements */; }; + 3472EC051B4D44BE0085CB79 /* UIFont+MapsMeFonts.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3472EC041B4D44BE0085CB79 /* UIFont+MapsMeFonts.mm */; }; 348E578E1B0F3752000FA02A /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EEB7E22111E9079400080A68 /* CoreLocation.framework */; }; 34A742FE1AE5461A00CE15EB /* index.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34A742FD1AE5461A00CE15EB /* index.cpp */; }; 34A743001AE5468200CE15EB /* storage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34A742FF1AE5468200CE15EB /* storage.cpp */; }; @@ -368,6 +369,8 @@ 347274761B0F4F3900756B37 /* me.maps.watchkitextension.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = me.maps.watchkitextension.entitlements; sourceTree = ""; }; 347274781B0F4FD900756B37 /* me.maps.watchkitextension.production.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = me.maps.watchkitextension.production.entitlements; sourceTree = ""; }; 3472747A1B0F4FF100756B37 /* me.maps.production.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = me.maps.production.entitlements; sourceTree = ""; }; + 3472EC031B4D44BE0085CB79 /* UIFont+MapsMeFonts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIFont+MapsMeFonts.h"; sourceTree = ""; }; + 3472EC041B4D44BE0085CB79 /* UIFont+MapsMeFonts.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "UIFont+MapsMeFonts.mm"; sourceTree = ""; }; 348E57981B0F49D8000FA02A /* maps.me dbg.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "maps.me dbg.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 348E57C81B0F49EE000FA02A /* maps.me WatchKit Extension WatchKit Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "maps.me WatchKit Extension WatchKit Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; 348E57D71B0F49EE000FA02A /* maps.me WatchKit App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "maps.me WatchKit App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1148,6 +1151,8 @@ F62404FA1AAF3DB200B58DB6 /* UILabel+RuntimeAttributes.mm */, F6F533A11B3C248900C1940B /* UIColor+MapsMeColor.h */, F6F533A21B3C248900C1940B /* UIColor+MapsMeColor.mm */, + 3472EC031B4D44BE0085CB79 /* UIFont+MapsMeFonts.h */, + 3472EC041B4D44BE0085CB79 /* UIFont+MapsMeFonts.mm */, ); name = Categories; sourceTree = ""; @@ -2191,6 +2196,7 @@ 97F61794183E7445009919E2 /* LinkCell.m in Sources */, 976D86EC19C8697700C920EF /* ProgressView.m in Sources */, B0FBFA271A515AFD0086819E /* ViewController.m in Sources */, + 3472EC051B4D44BE0085CB79 /* UIFont+MapsMeFonts.mm in Sources */, F63732961AE9431E00A03764 /* MWMBasePlacePageView.mm in Sources */, 97A8001018B21395000C07A2 /* SearchBar.mm in Sources */, EDC5C543175F2CA600420E92 /* ShareActionSheet.mm in Sources */, diff --git a/iphone/Maps/UIColor+MapsMeColor.h b/iphone/Maps/UIColor+MapsMeColor.h index 279ae6c874..55b7769da3 100644 --- a/iphone/Maps/UIColor+MapsMeColor.h +++ b/iphone/Maps/UIColor+MapsMeColor.h @@ -1,5 +1,5 @@ // -// MWMPlacePage+MapsMeColor.h +// UIColor+MapsMeColor.h // Maps // // Created by v.mikhaylenko on 25.06.15. diff --git a/iphone/Maps/UIFont+MapsMeFonts.h b/iphone/Maps/UIFont+MapsMeFonts.h new file mode 100644 index 0000000000..d0356f14fd --- /dev/null +++ b/iphone/Maps/UIFont+MapsMeFonts.h @@ -0,0 +1,26 @@ +// +// UIFont+MapsMeFonts.h +// Maps +// +// Created by Ilya Grechuhin on 08.07.15. +// Copyright (c) 2015 MapsWithMe. All rights reserved. +// + +#import + +@interface UIFont (MapsMeFonts) + ++ (UIFont *)regular10; ++ (UIFont *)regular14; ++ (UIFont *)regular16; ++ (UIFont *)regular17; ++ (UIFont *)regular18; ++ (UIFont *)regular24; ++ (UIFont *)light10; ++ (UIFont *)light12; ++ (UIFont *)light16; ++ (UIFont *)light17; ++ (UIFont *)bold16; ++ (UIFont *)bold48; + +@end diff --git a/iphone/Maps/UIFont+MapsMeFonts.mm b/iphone/Maps/UIFont+MapsMeFonts.mm new file mode 100644 index 0000000000..f0b72bf1f3 --- /dev/null +++ b/iphone/Maps/UIFont+MapsMeFonts.mm @@ -0,0 +1,73 @@ +// +// UIFont+MapsMeFonts.m +// Maps +// +// Created by Ilya Grechuhin on 08.07.15. +// Copyright (c) 2015 MapsWithMe. All rights reserved. +// + +#import "UIFont+MapsMeFonts.h" + +@implementation UIFont (MapsMeFonts) + ++ (UIFont *)regular10 +{ + return [UIFont fontWithName:@"HelveticaNeue" size:10]; +} + ++ (UIFont *)regular14 +{ + return [UIFont fontWithName:@"HelveticaNeue" size:14]; +} + ++ (UIFont *)regular16 +{ + return [UIFont fontWithName:@"HelveticaNeue" size:16]; +} + ++ (UIFont *)regular17 +{ + return [UIFont fontWithName:@"HelveticaNeue" size:17]; +} + ++ (UIFont *)regular18 +{ + return [UIFont fontWithName:@"HelveticaNeue" size:18]; +} + ++ (UIFont *)regular24 +{ + return [UIFont fontWithName:@"HelveticaNeue" size:24]; +} + ++ (UIFont *)light10 +{ + return [UIFont fontWithName:@"HelveticaNeue-Light" size:10]; +} + ++ (UIFont *)light12 +{ + return [UIFont fontWithName:@"HelveticaNeue-Light" size:12]; +} + ++ (UIFont *)light16 +{ + return [UIFont fontWithName:@"HelveticaNeue-Light" size:16]; +} + ++ (UIFont *)light17 +{ + return [UIFont fontWithName:@"HelveticaNeue-Light" size:17]; +} + ++ (UIFont *)bold16 +{ + return [UIFont fontWithName:@"HelveticaNeue-Bold" size:16]; +} + ++ (UIFont *)bold48 +{ + return [UIFont fontWithName:@"HelveticaNeue-Bold" size:48]; +} + +@end diff --git a/iphone/Maps/UILabel+RuntimeAttributes.mm b/iphone/Maps/UILabel+RuntimeAttributes.mm index d45bba7983..284a64916e 100644 --- a/iphone/Maps/UILabel+RuntimeAttributes.mm +++ b/iphone/Maps/UILabel+RuntimeAttributes.mm @@ -21,6 +21,14 @@ return L(self.text); } +- (void)setFontName:(NSString *)fontName +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + self.font = [[UIFont class] performSelector:NSSelectorFromString(fontName)]; +#pragma clang diagnostic pop +} + @end @implementation UIButton (RuntimeAttributes) @@ -33,6 +41,14 @@ return L([self titleForState:UIControlStateNormal]); } +- (void)setFontName:(NSString *)fontName +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + self.titleLabel.font = [[UIFont class] performSelector:NSSelectorFromString(fontName)]; +#pragma clang diagnostic pop +} + @end @implementation UITextField (RuntimeAttributes) @@ -47,6 +63,14 @@ return L(self.placeholder); } +- (void)setFontName:(NSString *)fontName +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + self.font = [[UIFont class] performSelector:NSSelectorFromString(fontName)]; +#pragma clang diagnostic pop +} + @end @implementation MWMTextView (RuntimeAttributes) @@ -61,4 +85,12 @@ return L(self.placeholder); } +- (void)setFontName:(NSString *)fontName +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + self.font = [[UIFont class] performSelector:NSSelectorFromString(fontName)]; +#pragma clang diagnostic pop +} + @end