summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLMapView.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/src/MGLMapView.mm')
-rw-r--r--platform/ios/src/MGLMapView.mm13
1 files changed, 11 insertions, 2 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 4d692fa718..b36efe3bd7 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -586,9 +586,18 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
UIGraphicsBeginImageContextWithOptions(scaleImage.size, NO, [UIScreen mainScreen].scale);
[scaleImage drawInRect:{ CGPointZero, scaleImage.size }];
- CGFloat weight = &UIFontWeightUltraLight ? UIFontWeightUltraLight : -0.8;
+ CGFloat northSize = 9;
+ UIFont *northFont;
+ if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)])
+ {
+ northFont = [UIFont systemFontOfSize:northSize weight:UIFontWeightUltraLight];
+ }
+ else
+ {
+ northFont = [UIFont systemFontOfSize:northSize];
+ }
NSAttributedString *north = [[NSAttributedString alloc] initWithString:NSLocalizedStringWithDefaultValue(@"COMPASS_NORTH", nil, nil, @"N", @"Compass abbreviation for north") attributes:@{
- NSFontAttributeName: [UIFont systemFontOfSize:9 weight:weight],
+ NSFontAttributeName: northFont,
NSForegroundColorAttributeName: [UIColor whiteColor],
}];
CGRect stringRect = CGRectMake((scaleImage.size.width - north.size.width) / 2,