diff options
author | Fabian Guerra <fabian.guerra@mapbox.com> | 2019-03-21 16:15:14 -0700 |
---|---|---|
committer | Fabian Guerra <fabian.guerra@mapbox.com> | 2019-03-21 16:15:14 -0700 |
commit | d6727c0bb9e888d4cdf72a09143e3fb2354d04dd (patch) | |
tree | 55b718e70e9a7ef0a1b8fd20fc18b39b592548f4 | |
parent | 07845b1208030b5920e73d04afeb5ecf7da903d6 (diff) | |
download | qtlocation-mapboxgl-d6727c0bb9e888d4cdf72a09143e3fb2354d04dd.tar.gz |
[ios, macos] Rename MGLFontSizeAttribute to MGLFontScaleAttribute.
-rw-r--r-- | platform/darwin/docs/guides/For Style Authors.md.ejs | 2 | ||||
-rw-r--r-- | platform/darwin/docs/guides/Predicates and Expressions.md | 2 | ||||
-rw-r--r-- | platform/darwin/src/MGLAttributedExpression.h | 10 | ||||
-rw-r--r-- | platform/darwin/src/MGLAttributedExpression.m | 8 | ||||
-rw-r--r-- | platform/darwin/test/MGLDocumentationExampleTests.swift | 2 | ||||
-rw-r--r-- | platform/darwin/test/MGLExpressionTests.mm | 34 | ||||
-rw-r--r-- | platform/ios/docs/guides/For Style Authors.md | 2 | ||||
-rw-r--r-- | platform/macos/docs/guides/For Style Authors.md | 2 |
8 files changed, 31 insertions, 31 deletions
diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs index cff6e2f41c..8df541d0f7 100644 --- a/platform/darwin/docs/guides/For Style Authors.md.ejs +++ b/platform/darwin/docs/guides/For Style Authors.md.ejs @@ -439,7 +439,7 @@ can use to update the formatting of `MGLSymbolStyleLayer.text` property. In style JSON | In Objective-C | In Swift --------------|-----------------------|--------- `text-font` | `MGLFontNamesAttribute` | `.fontNamesAttribute` -`font-scale` | `MGLFontSizeAttribute` | `.fontSizeAttribute` +`font-scale` | `MGLFontScaleAttribute` | `.fontScaleAttribute` `text-color` | `MGLFontColorAttribute` | `.fontColorAttribute` See the “[Predicates and Expressions](predicates-and-expressions.html)” guide for diff --git a/platform/darwin/docs/guides/Predicates and Expressions.md b/platform/darwin/docs/guides/Predicates and Expressions.md index 51617c8508..bb2e6c2d0e 100644 --- a/platform/darwin/docs/guides/Predicates and Expressions.md +++ b/platform/darwin/docs/guides/Predicates and Expressions.md @@ -551,7 +551,7 @@ with the `MGLSymbolStyleLayer.text` property. Key | Value Type --- | --- `MGLFontNamesAttribute` | `NSArray<NSString *>*` - `MGLFontSizeAttribute` | `NSNumber` + `MGLFontScaleAttribute` | `NSNumber` `MGLFontColorAttribute` | `UIColor` or `NSColor` on macos This function corresponds to the diff --git a/platform/darwin/src/MGLAttributedExpression.h b/platform/darwin/src/MGLAttributedExpression.h index 32f1a96dae..3f8bef49c2 100644 --- a/platform/darwin/src/MGLAttributedExpression.h +++ b/platform/darwin/src/MGLAttributedExpression.h @@ -5,7 +5,7 @@ NS_ASSUME_NONNULL_BEGIN typedef NSString * MGLAttributedExpressionKey NS_EXTENSIBLE_STRING_ENUM; FOUNDATION_EXTERN MGL_EXPORT MGLAttributedExpressionKey const MGLFontNamesAttribute; -FOUNDATION_EXTERN MGL_EXPORT MGLAttributedExpressionKey const MGLFontSizeAttribute; +FOUNDATION_EXTERN MGL_EXPORT MGLAttributedExpressionKey const MGLFontScaleAttribute; FOUNDATION_EXTERN MGL_EXPORT MGLAttributedExpressionKey const MGLFontColorAttribute; /** @@ -18,7 +18,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLAttributedExpressionKey const MGLFontColorAttrib let expression = NSExpression(forConstantValue: "Foo") let attributes: Dictionary<MGLAttributedExpressionKey, Any> = [.fontNamesAttribute : ["DIN Offc Pro Italic", "Arial Unicode MS Regular"], - .fontSizeAttribute: 1.2, + .fontScaleAttribute: 1.2, .fontColorAttribute: redColor] let attributedExpression = MGLAttributedExpression(expression, attributes:attributes) ``` @@ -38,7 +38,7 @@ MGL_EXPORT Key | Value Type --- | --- `MGLFontNamesAttribute` | `NSArray<NSString *>*` - `MGLFontSizeAttribute` | `NSNumber` + `MGLFontScaleAttribute` | `NSNumber` `MGLFontColorAttribute` | `UIColor` */ @@ -49,7 +49,7 @@ MGL_EXPORT Key | Value Type --- | --- `MGLFontNamesAttribute` | `NSArray<NSString *>*` - `MGLFontSizeAttribute` | `NSNumber` + `MGLFontScaleAttribute` | `NSNumber` `MGLFontColorAttribute` | `NSColor` */ @property (strong, nonatomic, readonly) NSDictionary<MGLAttributedExpressionKey, id> *attributes; @@ -69,7 +69,7 @@ MGL_EXPORT /** Creates an `MGLAttributedExpression` object initialized with an expression and the format attributes for font names and font size. */ -+ (instancetype)attributedExpression:(NSExpression *)expression fontNames:(nullable NSArray<NSString*> *)fontNames fontSize:(nullable NSNumber *)fontSize; ++ (instancetype)attributedExpression:(NSExpression *)expression fontNames:(nullable NSArray<NSString*> *)fontNames fontScale:(nullable NSNumber *)fontScale; /** Creates an `MGLAttributedExpression` object initialized with an expression and the format attributes dictionary. diff --git a/platform/darwin/src/MGLAttributedExpression.m b/platform/darwin/src/MGLAttributedExpression.m index 000701f7cf..4283e98b94 100644 --- a/platform/darwin/src/MGLAttributedExpression.m +++ b/platform/darwin/src/MGLAttributedExpression.m @@ -2,7 +2,7 @@ #import "MGLLoggingConfiguration_Private.h" const MGLAttributedExpressionKey MGLFontNamesAttribute = @"text-font"; -const MGLAttributedExpressionKey MGLFontSizeAttribute = @"font-scale"; +const MGLAttributedExpressionKey MGLFontScaleAttribute = @"font-scale"; const MGLAttributedExpressionKey MGLFontColorAttribute = @"text-color"; @implementation MGLAttributedExpression @@ -12,7 +12,7 @@ const MGLAttributedExpressionKey MGLFontColorAttribute = @"text-color"; return self; } -+ (instancetype)attributedExpression:(NSExpression *)expression fontNames:(nullable NSArray<NSString *> *)fontNames fontSize:(nullable NSNumber *)fontSize { ++ (instancetype)attributedExpression:(NSExpression *)expression fontNames:(nullable NSArray<NSString *> *)fontNames fontScale:(nullable NSNumber *)fontScale { MGLAttributedExpression *attributedExpression; NSMutableDictionary *attrs = [NSMutableDictionary dictionary]; @@ -21,8 +21,8 @@ const MGLAttributedExpressionKey MGLFontColorAttribute = @"text-color"; attrs[MGLFontNamesAttribute] = fontNames; } - if (fontSize) { - attrs[MGLFontSizeAttribute] = fontSize; + if (fontScale) { + attrs[MGLFontScaleAttribute] = fontScale; } attributedExpression = [[self alloc] initWithExpression:expression attributes:attrs]; diff --git a/platform/darwin/test/MGLDocumentationExampleTests.swift b/platform/darwin/test/MGLDocumentationExampleTests.swift index 45efe4c591..c571b15a96 100644 --- a/platform/darwin/test/MGLDocumentationExampleTests.swift +++ b/platform/darwin/test/MGLDocumentationExampleTests.swift @@ -552,7 +552,7 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { let expression = NSExpression(forConstantValue: "Foo") let attributes: Dictionary<MGLAttributedExpressionKey, Any> = [.fontNamesAttribute : ["DIN Offc Pro Italic", "Arial Unicode MS Regular"], - .fontSizeAttribute: 1.2, + .fontScaleAttribute: 1.2, .fontColorAttribute: redColor] let attributedExpression = MGLAttributedExpression(expression, attributes:attributes) //#-end-example-code diff --git a/platform/darwin/test/MGLExpressionTests.mm b/platform/darwin/test/MGLExpressionTests.mm index 2a4d40b4c5..bc0348343b 100644 --- a/platform/darwin/test/MGLExpressionTests.mm +++ b/platform/darwin/test/MGLExpressionTests.mm @@ -992,16 +992,16 @@ using namespace std::string_literals; { MGLAttributedExpression *attribute1 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"foo"] fontNames:nil - fontSize:@(1.2)]; + fontScale:@(1.2)]; MGLAttributedExpression *attribute2 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"biz"] fontNames:nil - fontSize:@(1.0)]; + fontScale:@(1.0)]; MGLAttributedExpression *attribute3 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"bar"] fontNames:nil - fontSize:@(0.8)]; + fontScale:@(0.8)]; MGLAttributedExpression *attribute4 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"\r"] fontNames:@[] - fontSize:nil]; + fontScale:nil]; NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@, %@, %@, %@)", MGLConstantExpression(attribute1), MGLConstantExpression(attribute4), @@ -1014,16 +1014,16 @@ using namespace std::string_literals; { MGLAttributedExpression *attribute1 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"foo"] fontNames:nil - fontSize:@(1.2)]; + fontScale:@(1.2)]; MGLAttributedExpression *attribute2 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"biz"] fontNames:nil - fontSize:@(1.0)]; + fontScale:@(1.0)]; MGLAttributedExpression *attribute3 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"bar"] fontNames:nil - fontSize:@(0.8)]; + fontScale:@(0.8)]; MGLAttributedExpression *attribute4 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"\n"] fontNames:@[] - fontSize:nil]; + fontScale:nil]; NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@, %@, %@, %@)", MGLConstantExpression(attribute1), MGLConstantExpression(attribute4), @@ -1036,7 +1036,7 @@ using namespace std::string_literals; { MGLAttributedExpression *attribute1 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"foo"] fontNames:nil - fontSize:@(1.2)]; + fontScale:@(1.2)]; NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MGLConstantExpression(attribute1)]; NSExpression *compatibilityExpression = [NSExpression expressionForFunction:@"mgl_attributed:" arguments:@[MGLConstantExpression(attribute1)]]; @@ -1048,7 +1048,7 @@ using namespace std::string_literals; } { MGLAttributedExpression *attribute1 = [[MGLAttributedExpression alloc] initWithExpression:[NSExpression expressionForConstantValue:@"foo"] - attributes:@{ MGLFontSizeAttribute: @(1.2), + attributes:@{ MGLFontScaleAttribute: @(1.2), MGLFontColorAttribute: @"yellow"}] ; NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MGLConstantExpression(attribute1)]; @@ -1069,7 +1069,7 @@ using namespace std::string_literals; } { MGLAttributedExpression *attribute1 = [[MGLAttributedExpression alloc] initWithExpression:[NSExpression expressionForConstantValue:@"foo"] - attributes:@{ MGLFontSizeAttribute: @(1.2), + attributes:@{ MGLFontScaleAttribute: @(1.2), MGLFontColorAttribute: @"yellow", MGLFontNamesAttribute: @[ @"DIN Offc Pro Bold", @"Arial Unicode MS Bold" ] }] ; @@ -1081,7 +1081,7 @@ using namespace std::string_literals; } { MGLAttributedExpression *attribute1 = [[MGLAttributedExpression alloc] initWithExpression:[NSExpression expressionForConstantValue:@"foo"] - attributes:@{ MGLFontSizeAttribute: @(1.2), + attributes:@{ MGLFontScaleAttribute: @(1.2), MGLFontColorAttribute: [MGLColor redColor], MGLFontNamesAttribute: @[ @"DIN Offc Pro Bold", @"Arial Unicode MS Bold" ] }] ; @@ -1093,7 +1093,7 @@ using namespace std::string_literals; } { MGLAttributedExpression *attribute1 = [[MGLAttributedExpression alloc] initWithExpression:[NSExpression expressionWithFormat:@"CAST(x, 'NSString')"] - attributes:@{ MGLFontSizeAttribute: @(1.2), + attributes:@{ MGLFontScaleAttribute: @(1.2), MGLFontColorAttribute: [MGLColor redColor], MGLFontNamesAttribute: @[ @"DIN Offc Pro Bold", @"Arial Unicode MS Bold" ] }] ; @@ -1106,16 +1106,16 @@ using namespace std::string_literals; { MGLAttributedExpression *attribute1 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"foo"] fontNames:nil - fontSize:@(1.2)]; + fontScale:@(1.2)]; MGLAttributedExpression *attribute2 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"biz"] fontNames:nil - fontSize:@(1.0)]; + fontScale:@(1.0)]; MGLAttributedExpression *attribute3 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"bar"] fontNames:nil - fontSize:@(0.8)]; + fontScale:@(0.8)]; MGLAttributedExpression *attribute4 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"\n"] fontNames:@[] - fontSize:nil]; + fontScale:nil]; NSExpression *expression = [NSExpression mgl_expressionForAttributedExpressions:@[MGLConstantExpression(attribute1), MGLConstantExpression(attribute4), MGLConstantExpression(attribute2), diff --git a/platform/ios/docs/guides/For Style Authors.md b/platform/ios/docs/guides/For Style Authors.md index 44d5e47262..1acf587cda 100644 --- a/platform/ios/docs/guides/For Style Authors.md +++ b/platform/ios/docs/guides/For Style Authors.md @@ -426,7 +426,7 @@ can use to update the formatting of `MGLSymbolStyleLayer.text` property. In style JSON | In Objective-C | In Swift --------------|-----------------------|--------- `text-font` | `MGLFontNamesAttribute` | `.fontNamesAttribute` -`font-scale` | `MGLFontSizeAttribute` | `.fontSizeAttribute` +`font-scale` | `MGLFontScaleAttribute` | `.fontScaleAttribute` `text-color` | `MGLFontColorAttribute` | `.fontColorAttribute` See the “[Predicates and Expressions](predicates-and-expressions.html)” guide for diff --git a/platform/macos/docs/guides/For Style Authors.md b/platform/macos/docs/guides/For Style Authors.md index 220ce3d50e..5a81eb3593 100644 --- a/platform/macos/docs/guides/For Style Authors.md +++ b/platform/macos/docs/guides/For Style Authors.md @@ -419,7 +419,7 @@ can use to update the formatting of `MGLSymbolStyleLayer.text` property. In style JSON | In Objective-C | In Swift --------------|-----------------------|--------- `text-font` | `MGLFontNamesAttribute` | `.fontNamesAttribute` -`font-scale` | `MGLFontSizeAttribute` | `.fontSizeAttribute` +`font-scale` | `MGLFontScaleAttribute` | `.fontScaleAttribute` `text-color` | `MGLFontColorAttribute` | `.fontColorAttribute` See the “[Predicates and Expressions](predicates-and-expressions.html)” guide for |