aboutsummaryrefslogtreecommitdiff
path: root/src/osx/graphics/quartz/Font.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osx/graphics/quartz/Font.cpp')
-rw-r--r--src/osx/graphics/quartz/Font.cpp15
1 files changed, 14 insertions, 1 deletions
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