diff options
author | crupest <crupest@outlook.com> | 2022-06-04 23:09:08 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-06-04 23:09:08 +0800 |
commit | a49064e065eef5de51ba188f691c610dd0a9fcaf (patch) | |
tree | e98bd45d0167a794ae42ed9105d9a525c26dc43d /src/platform/graphics/cairo | |
parent | ea913d6818ae7dfa0663ab99c5908d1008a076b1 (diff) | |
download | cru-a49064e065eef5de51ba188f691c610dd0a9fcaf.tar.gz cru-a49064e065eef5de51ba188f691c610dd0a9fcaf.tar.bz2 cru-a49064e065eef5de51ba188f691c610dd0a9fcaf.zip |
...
Diffstat (limited to 'src/platform/graphics/cairo')
-rw-r--r-- | src/platform/graphics/cairo/PangoFont.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/platform/graphics/cairo/PangoFont.cpp b/src/platform/graphics/cairo/PangoFont.cpp index f43b6c55..0de17add 100644 --- a/src/platform/graphics/cairo/PangoFont.cpp +++ b/src/platform/graphics/cairo/PangoFont.cpp @@ -5,9 +5,17 @@ PangoFont::PangoFont(CairoGraphicsFactory* factory, String font_family, float font_size) : CairoResource(factory), font_family_(std::move(font_family)), - font_size_(font_size) {} + font_size_(font_size) { + pango_font_description_ = pango_font_description_new(); + auto font_family_str = font_family_.ToUtf8(); + pango_font_description_set_family(pango_font_description_, + font_family_str.c_str()); + pango_font_description_set_size(pango_font_description_, font_size); +} -PangoFont::~PangoFont() {} +PangoFont::~PangoFont() { + pango_font_description_free(pango_font_description_); +} String PangoFont::GetFontName() { return font_family_; } |