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;