diff options
author | crupest <crupest@outlook.com> | 2021-09-06 11:52:21 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-09-06 11:52:21 +0800 |
commit | 16007714fc0ad365c6da52dc58201ba4bc6aa964 (patch) | |
tree | 7ce745b2ab79f6ae057d03c18b875a3661eeca1f /src/osx/graphics/quartz/Font.cpp | |
parent | c504aef3835f71ea22c9e938066f01e69e1c2db3 (diff) | |
download | cru-16007714fc0ad365c6da52dc58201ba4bc6aa964.tar.gz cru-16007714fc0ad365c6da52dc58201ba4bc6aa964.tar.bz2 cru-16007714fc0ad365c6da52dc58201ba4bc6aa964.zip |
...
Diffstat (limited to 'src/osx/graphics/quartz/Font.cpp')
-rw-r--r-- | src/osx/graphics/quartz/Font.cpp | 15 |
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 |