From ac6810df2deaf12e5ade0ed05be89bf6b8f6c076 Mon Sep 17 00:00:00 2001 From: Lloyd Sheng Date: Tue, 26 Feb 2019 13:18:22 +0800 Subject: [PATCH 1/2] Make PingFang as the default local font family --- platform/darwin/src/MGLRendererConfiguration.h | 5 +++-- platform/darwin/src/MGLRendererConfiguration.mm | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/darwin/src/MGLRendererConfiguration.h b/platform/darwin/src/MGLRendererConfiguration.h index ea13582488f..a2ad4d6cdcd 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 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 90778ea86d0..7a2f95cfdab 100644 --- a/platform/darwin/src/MGLRendererConfiguration.mm +++ b/platform/darwin/src/MGLRendererConfiguration.mm @@ -77,10 +77,10 @@ - (const float)scaleFactor { return mbgl::optional(); } -- (mbgl::optional)localFontFamilyName { +- (std::string)localFontFamilyName { NSString *fontFamilyName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLIdeographicFontFamilyName"]; - return fontFamilyName ? std::string([fontFamilyName UTF8String]) : mbgl::optional(); + return fontFamilyName ? std::string([fontFamilyName UTF8String]) : std::string("PingFang"); } @end From 5173ce6f5100b114651200558173c82da4285da1 Mon Sep 17 00:00:00 2001 From: Lloyd Sheng Date: Wed, 27 Feb 2019 14:24:04 +0800 Subject: [PATCH 2/2] Add a changelog --- platform/ios/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 34977e2a03d..e567c06ab20 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -8,6 +8,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Improved tilt gesture performance. ([#13902](https://github.com/mapbox/mapbox-gl-native/pull/13902)) * Fixed a bug where `layoutSubviews` was always called on device rotation, regardless of the application's or top-most view controller's supported orientations. ([#13900](https://github.com/mapbox/mapbox-gl-native/pull/13900)) * Added `MGLNetworkConfiguration` class to customize the SDK's `NSURLSessionConfiguration` object. ([#11447](https://github.com/mapbox/mapbox-gl-native/pull/13886)) +* Made PingFang as the default local font family for CJK glyphs. ([#13988](https://github.com/mapbox/mapbox-gl-native/pull/13988)) ## 4.8.0 - January 30, 2019