From 85861cc24c5a2cb02fb6bb3432dda51732ffc348 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sat, 13 Jan 2018 20:43:55 -1000 Subject: [PATCH] Don't defeat font texture cache --- specter/include/specter/FontCache.hpp | 2 +- specter/lib/FontCache.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specter/include/specter/FontCache.hpp b/specter/include/specter/FontCache.hpp index 2b76809eb..bf2155c30 100644 --- a/specter/include/specter/FontCache.hpp +++ b/specter/include/specter/FontCache.hpp @@ -56,7 +56,6 @@ using FCharFilter = std::pair>; class FontAtlas { - friend class FontCache; FT_Face m_face; std::vector m_texmap; boo::ObjToken m_tex; @@ -128,6 +127,7 @@ public: FT_Fixed FT_Xscale() const {return m_ftXscale;} FT_UShort FT_XPPem() const {return m_ftXPpem;} FT_Pos FT_LineHeight() const {return m_lineHeight;} + bool isReady() const { return m_ready; } boo::ObjToken texture(boo::IGraphicsDataFactory* gf) const; bool subpixel() const {return m_subpixel;} diff --git a/specter/lib/FontCache.cpp b/specter/lib/FontCache.cpp index cebd718e3..25f9eae72 100644 --- a/specter/lib/FontCache.cpp +++ b/specter/lib/FontCache.cpp @@ -721,7 +721,7 @@ FontTag FontCache::prepCustomFont(std::string_view name, FT_Face face, if (r.position() == 4 && magic == 'FONT') { std::unique_ptr fa = std::make_unique(face, dpi, subpixel, filter, r); - if (fa->m_tex) + if (fa->isReady()) { m_cachedAtlases.emplace(tag, std::move(fa)); return tag;