aboutsummaryrefslogtreecommitdiff
path: root/src/osx
diff options
context:
space:
mode:
Diffstat (limited to 'src/osx')
-rw-r--r--src/osx/graphics/quartz/CMakeLists.txt2
-rw-r--r--src/osx/graphics/quartz/Font.cpp15
-rw-r--r--src/osx/graphics/quartz/TextLayout.cpp5
3 files changed, 21 insertions, 1 deletions
diff --git a/src/osx/graphics/quartz/CMakeLists.txt b/src/osx/graphics/quartz/CMakeLists.txt
index d58b7ecc..c6bb29cb 100644
--- a/src/osx/graphics/quartz/CMakeLists.txt
+++ b/src/osx/graphics/quartz/CMakeLists.txt
@@ -8,6 +8,7 @@ add_library(cru_osx_graphics_quartz SHARED
Geometry.cpp
Painter.cpp
Resource.cpp
+ TextLayout.cpp
)
target_sources(cru_osx_graphics_quartz PUBLIC
${CRU_OSX_GRAPHICS_NATIVE_INCLUDE_DIR}/Brush.hpp
@@ -17,6 +18,7 @@ target_sources(cru_osx_graphics_quartz PUBLIC
${CRU_OSX_GRAPHICS_NATIVE_INCLUDE_DIR}/Geometry.hpp
${CRU_OSX_GRAPHICS_NATIVE_INCLUDE_DIR}/Painter.hpp
${CRU_OSX_GRAPHICS_NATIVE_INCLUDE_DIR}/Resource.hpp
+ ${CRU_OSX_GRAPHICS_NATIVE_INCLUDE_DIR}/TextLayout.hpp
)
target_link_libraries(cru_osx_graphics_quartz PUBLIC cocoa)
target_link_libraries(cru_osx_graphics_quartz PUBLIC cru_osx_base cru_platform_graphics)
diff --git a/src/osx/graphics/quartz/Font.cpp b/src/osx/graphics/quartz/Font.cpp
index 15ef9b21..e6c1dc91 100644
--- a/src/osx/graphics/quartz/Font.cpp
+++ b/src/osx/graphics/quartz/Font.cpp
@@ -1,5 +1,18 @@
#include "cru/osx/graphics/quartz/Font.hpp"
+#include "cru/osx/graphics/quartz/Convert.hpp"
+#include "cru/osx/graphics/quartz/Resource.hpp"
+
namespace cru::platform::graphics::osx::quartz {
-
+OsxCTFont::OsxCTFont(IGraphFactory* graphics_factory, const String& name,
+ float size)
+ : OsxQuartzResource(graphics_factory) {
+ CFStringRef n = Convert(name);
+
+ ct_font_ = CTFontCreateWithName(n, size, nullptr);
+
+ CFRelease(n);
}
+
+OsxCTFont::~OsxCTFont() { CFRelease(ct_font_); }
+} // namespace cru::platform::graphics::osx::quartz
diff --git a/src/osx/graphics/quartz/TextLayout.cpp b/src/osx/graphics/quartz/TextLayout.cpp
new file mode 100644
index 00000000..bd0562cb
--- /dev/null
+++ b/src/osx/graphics/quartz/TextLayout.cpp
@@ -0,0 +1,5 @@
+#include "cru/osx/graphics/quartz/TextLayout.hpp"
+
+namespace cru::platform::graphics::osx::quartz {
+
+}