diff options
Diffstat (limited to 'platform/macos')
-rw-r--r-- | platform/macos/config.cmake | 4 | ||||
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/platform/macos/config.cmake b/platform/macos/config.cmake index 3e7f548bab..33eaa82518 100644 --- a/platform/macos/config.cmake +++ b/platform/macos/config.cmake @@ -14,11 +14,12 @@ macro(mbgl_platform_core) # Misc PRIVATE platform/darwin/mbgl/storage/reachability.h PRIVATE platform/darwin/mbgl/storage/reachability.m + PRIVATE platform/darwin/src/CFHandle.hpp + PRIVATE platform/darwin/src/local_glyph_rasterizer.mm PRIVATE platform/darwin/src/logging_nslog.mm PRIVATE platform/darwin/src/nsthread.mm PRIVATE platform/darwin/src/string_nsstring.mm PRIVATE platform/default/bidi.cpp - PRIVATE platform/default/local_glyph_rasterizer.cpp PRIVATE platform/default/thread_local.cpp PRIVATE platform/default/utf.cpp @@ -64,6 +65,7 @@ macro(mbgl_platform_core) target_link_libraries(mbgl-core PUBLIC "-lz" PUBLIC "-framework Foundation" + PUBLIC "-framework CoreText" PUBLIC "-framework CoreGraphics" PUBLIC "-framework OpenGL" PUBLIC "-framework ImageIO" diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index c2c13320c7..5fb70d775a 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -217,7 +217,7 @@ public: - (instancetype)initWithFrame:(NSRect)frameRect { if (self = [super initWithFrame:frameRect]) { - [self commonInit]; + [self commonInit:nil]; self.styleURL = nil; } return self; @@ -225,7 +225,7 @@ public: - (instancetype)initWithFrame:(NSRect)frame styleURL:(nullable NSURL *)styleURL { if (self = [super initWithFrame:frame]) { - [self commonInit]; + [self commonInit:nil]; self.styleURL = styleURL; } return self; @@ -233,7 +233,7 @@ public: - (instancetype)initWithCoder:(nonnull NSCoder *)decoder { if (self = [super initWithCoder:decoder]) { - [self commonInit]; + [self commonInit:nil]; } return self; } @@ -252,7 +252,7 @@ public: return @[@"camera", @"debugMask"]; } -- (void)commonInit { +- (void)commonInit:(nullable NSString*)fontFamily { _isTargetingInterfaceBuilder = NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent; // Set up cross-platform controllers and resources. @@ -274,7 +274,7 @@ public: _mbglThreadPool = mbgl::sharedThreadPool(); - auto renderer = std::make_unique<mbgl::Renderer>(*_mbglView, [NSScreen mainScreen].backingScaleFactor, *mbglFileSource, *_mbglThreadPool, mbgl::GLContextMode::Unique); + auto renderer = std::make_unique<mbgl::Renderer>(*_mbglView, [NSScreen mainScreen].backingScaleFactor, *mbglFileSource, *_mbglThreadPool, mbgl::GLContextMode::Unique, mbgl::optional<std::string>(), fontFamily ? std::string([fontFamily UTF8String]) : mbgl::optional<std::string>()); _rendererFrontend = std::make_unique<MGLRenderFrontend>(std::move(renderer), self, *_mbglView, true); _mbglMap = new mbgl::Map(*_rendererFrontend, *_mbglView, self.size, [NSScreen mainScreen].backingScaleFactor, *mbglFileSource, *_mbglThreadPool, mbgl::MapMode::Continuous, mbgl::ConstrainMode::None, mbgl::ViewportMode::Default); |