C
MCU.Config.glyphsLayoutCacheSize
Description
This property specifies the desired glyph layout cache size. This cache contains glyph shaping and layout data.
Ensure that the configured cache size is large enough to fit the longest string to be displayed in the application. Ideally, the cache should be able to accommodate all strings that are visible at the same time. This avoids the need to evict and recreate cache entries. Determining the optimal size may require some trial and error. If allocation fails, the error code is QulError_GlyphLayoutCache_GlyphDataDoesNotFitInCache.
The memory for the glyph layout cache is allocated from the platform layer via Qul::PlatformInterface::MemoryAllocator::GlyphLayoutCache. A single memory buffer is preallocated and managed internally by the glyph layout cache. The actual buffer size may be slightly larger than the value specified in MCU.Config.glyphsLayoutCacheSize
, to account for internal bookkeeping.
The cache manages entry allocations within this buffer, recycling entries using an LRU strategy.
The default value is 24 KB.
Usage
This property is accepted in the main application .qmlproject
file. It takes an integer.
Code example:
MCU.Config { glyphsLayoutCacheSize: 30000 }
If you are using the old (non-qmlproject) build setup, the cache size can be configured by setting the CMake definition GLYPHS_LAYOUT_CACHE_SIZE
to the desired value.
Since
This property was introduced in QmlProject API 1.12.
See also Text caching.
Available under certain Qt licenses.
Find out more.