CacheHandler(const CacheHandler&) = delete;
CacheHandler& operator=(const CacheHandler&) = delete;
- std::size_t mFontDescriptionSizeCacheMaxSize; ///< The maximum capacity of font description size cache.
using DescriptionCacheContainer = LRUCacheContainer<FontDescriptionSizeCacheKey, FontCacheIndex, FontDescriptionSizeCacheKeyHash>;
public: // Cache container list
// So set cacheDescription=false, that we don't call CacheFontPath().
fontId = GetFontIdByPath(description.path, requestedPointSize, faceIndex, false, variationsMapPtr);
- if(mCacheHandler->IsFontIdCacheItemExist(fontId - 1u))
+ if(fontId > 0u && mCacheHandler->IsFontIdCacheItemExist(fontId - 1u))
{
fontCacheIndex = mCacheHandler->FindFontIdCacheItem(fontId - 1u).index;
mCacheHandler->FindFontFaceCacheItem(fontCacheIndex).mCharacterSet = FcCharSetCopy(mCacheHandler->mCharacterSetCache[fontDescriptionId - 1u]);