From 32ce1ce3473253644d1237227706e4f8ce55ab7a Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 28 Oct 2018 23:30:49 +0100 Subject: Add: [OSX] Text layout using the native CoreText API. By default, the native API will be used instead of ICU, but if ICU is forced in using configure, it will take precedence. --- src/fontcache.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/fontcache.cpp') diff --git a/src/fontcache.cpp b/src/fontcache.cpp index 3a5dd886c..55da0c55c 100644 --- a/src/fontcache.cpp +++ b/src/fontcache.cpp @@ -210,6 +210,7 @@ class FreeTypeFontCache : public FontCache { private: FT_Face face; ///< The font face associated with this font. int req_size; ///< Requested font size. + int used_size; ///< Used font size. typedef SmallMap > FontTable; ///< Table with font table cache FontTable font_tables; ///< Cached font tables. @@ -243,6 +244,7 @@ private: public: FreeTypeFontCache(FontSize fs, FT_Face face, int pixels); ~FreeTypeFontCache(); + virtual int GetFontSize() const { return this->used_size; } virtual SpriteID GetUnicodeGlyph(WChar key) { return this->parent->GetUnicodeGlyph(key); } virtual void SetUnicodeGlyph(WChar key, SpriteID sprite) { this->parent->SetUnicodeGlyph(key, sprite); } virtual void InitializeUnicodeGlyphMap() { this->parent->InitializeUnicodeGlyphMap(); } @@ -291,6 +293,7 @@ void FreeTypeFontCache::SetFontSize(FontSize fs, FT_Face face, int pixels) pixels = Clamp(min(head->Lowest_Rec_PPEM, 20) + diff, scaled_height, MAX_FONT_SIZE); } } + this->used_size = pixels; FT_Error err = FT_Set_Pixel_Sizes(this->face, 0, pixels); if (err != FT_Err_Ok) { -- cgit v1.2.3-54-g00ecf