summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLloyd Sheng <i@lloydsheng.com>2019-02-26 13:18:22 +0800
committerLloyd Sheng <i@lloydsheng.com>2019-02-26 13:18:22 +0800
commitac6810df2deaf12e5ade0ed05be89bf6b8f6c076 (patch)
tree33d141fccf924f96d89d9e312821062a8dc6839d
parentd34f0f0ef126ab794990a306a7a682daa1dbb3c8 (diff)
downloadqtlocation-mapboxgl-ac6810df2deaf12e5ade0ed05be89bf6b8f6c076.tar.gz
Make PingFang as the default local font family
-rw-r--r--platform/darwin/src/MGLRendererConfiguration.h5
-rw-r--r--platform/darwin/src/MGLRendererConfiguration.mm4
2 files changed, 5 insertions, 4 deletions
diff --git a/platform/darwin/src/MGLRendererConfiguration.h b/platform/darwin/src/MGLRendererConfiguration.h
index ea13582488..a2ad4d6cdc 100644
--- a/platform/darwin/src/MGLRendererConfiguration.h
+++ b/platform/darwin/src/MGLRendererConfiguration.h
@@ -34,8 +34,9 @@ MGL_EXPORT
Currently only used for CJK glyphs. Changing this at run time is not currently
supported. Enable client-side rendering of CJK glyphs by setting
`MGLIdeographicFontFamilyName` in your containing app's Info.plist to a value
- which will be available at run time, e.g. "PingFang". */
-@property (nonatomic, readonly) mbgl::optional<std::string> localFontFamilyName;
+ which will be available at run time. Default font for local ideograph font family
+ is "PingFang". */
+@property (nonatomic, readonly) std::string localFontFamilyName;
/**
A Boolean value indicating whether symbol layers may enable per-source symbol
diff --git a/platform/darwin/src/MGLRendererConfiguration.mm b/platform/darwin/src/MGLRendererConfiguration.mm
index 90778ea86d..7a2f95cfda 100644
--- a/platform/darwin/src/MGLRendererConfiguration.mm
+++ b/platform/darwin/src/MGLRendererConfiguration.mm
@@ -77,10 +77,10 @@ static NSString * const MGLCollisionBehaviorPre4_0Key = @"MGLCollisionBehaviorPr
return mbgl::optional<std::string>();
}
-- (mbgl::optional<std::string>)localFontFamilyName {
+- (std::string)localFontFamilyName {
NSString *fontFamilyName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLIdeographicFontFamilyName"];
- return fontFamilyName ? std::string([fontFamilyName UTF8String]) : mbgl::optional<std::string>();
+ return fontFamilyName ? std::string([fontFamilyName UTF8String]) : std::string("PingFang");
}
@end