summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLCompassButton.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/src/MGLCompassButton.mm')
-rw-r--r--platform/ios/src/MGLCompassButton.mm9
1 files changed, 8 insertions, 1 deletions
diff --git a/platform/ios/src/MGLCompassButton.mm b/platform/ios/src/MGLCompassButton.mm
index 94a6820a74..acb25a560c 100644
--- a/platform/ios/src/MGLCompassButton.mm
+++ b/platform/ios/src/MGLCompassButton.mm
@@ -63,9 +63,16 @@
UIImage *scaleImage = [UIImage mgl_resourceImageNamed:@"Compass"];
UIGraphicsBeginImageContextWithOptions(scaleImage.size, NO, UIScreen.mainScreen.scale);
[scaleImage drawInRect:{CGPointZero, scaleImage.size}];
+
+ UIFont *northFont;
+ if (@available(iOS 13.0, *)) {
+ northFont = [UIFont systemFontOfSize:11 weight:UIFontWeightLight];
+ } else {
+ northFont = [UIFont systemFontOfSize:11 weight:UIFontWeightUltraLight];
+ }
NSAttributedString *north = [[NSAttributedString alloc] initWithString:NSLocalizedStringWithDefaultValue(@"COMPASS_NORTH", nil, nil, @"N", @"Compass abbreviation for north") attributes:@{
- NSFontAttributeName: [UIFont systemFontOfSize:11 weight:UIFontWeightUltraLight],
+ NSFontAttributeName: northFont,
NSForegroundColorAttributeName: [UIColor whiteColor],
}];
CGRect stringRect = CGRectMake((scaleImage.size.width - north.size.width) / 2,