Merge branch 'master' into jgrpp

This commit is contained in:
Jonathan G Rennison
2023-07-04 00:18:25 +01:00
8 changed files with 9 additions and 8 deletions

View File

@@ -30,7 +30,7 @@ public:
void ClearFontCache() override;
GlyphID MapCharToGlyph(WChar key) override;
const char *GetFontName() override { return font_name.c_str(); }
std::string GetFontName() override { return font_name; }
bool IsBuiltInFont() override { return false; }
const void *GetOSHandle() override { return font.get(); }
};

View File

@@ -180,7 +180,7 @@ static CTRunDelegateCallbacks _sprite_font_callback = {
if (font == nullptr) {
if (!_font_cache[i.second->fc->GetSize()]) {
/* Cache font information. */
CFAutoRelease<CFStringRef> font_name(CFStringCreateWithCString(kCFAllocatorDefault, i.second->fc->GetFontName(), kCFStringEncodingUTF8));
CFAutoRelease<CFStringRef> font_name(CFStringCreateWithCString(kCFAllocatorDefault, i.second->fc->GetFontName().c_str(), kCFStringEncodingUTF8));
_font_cache[i.second->fc->GetSize()].reset(CTFontCreateWithName(font_name.get(), i.second->fc->GetFontSize(), nullptr));
}
font = _font_cache[i.second->fc->GetSize()].get();

View File

@@ -34,7 +34,7 @@ public:
~Win32FontCache();
void ClearFontCache() override;
GlyphID MapCharToGlyph(WChar key) override;
const char *GetFontName() override { return this->fontname.c_str(); }
std::string GetFontName() override { return this->fontname; }
const void *GetOSHandle() override { return &this->logfont; }
};