Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[ios] Make PingFang as the default local font family #13988

Merged
merged 2 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions platform/darwin/src/MGLRendererConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions platform/darwin/src/MGLRendererConfiguration.mm
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ - (const float)scaleFactor {
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