C
MCU.Config.glyphsLayoutCacheExhaustionPolicy
Description
When a text's glyph data does not fit the free space in the cache, the cache first recycles entries using an LRU strategy to make room. If an allocation still fails – fragmentation can defeat it even when the total free space would suffice – the layout is retried once from an emptied cache, so a text that failed only because the cache had become fragmented still renders.
This property selects what happens when that retry also fails, which means the text does not fit even an otherwise-empty cache – that is, the cache configured through MCU.Config.glyphsLayoutCacheSize is too small for it.
RenderNothing(default): the text is not drawn and a hint naming the configured cache size is logged, so the rest of the UI keeps running. The hint is logged on the 1st, 2nd, 4th, 8th, ... occurrence, which keeps it visible during development without flooding the console while an undersized cache is on screen.Halt: report QulError_GlyphLayoutCache_GlyphDataDoesNotFitInCache through Qul::PlatformInterface::error, so an undersized cache surfaces immediately.
Under RenderNothing the text is not lost permanently: layout is retried on later updates, so it renders again once it is small enough to fit – for example if its content changes to a shorter string, or its layout settings change, such as a smaller font size. Freeing other cached text does not help, as the layout is already retried against an emptied cache.
Either way the cache size is the thing to fix: see MCU.Config.glyphsLayoutCacheSize for how to size it.
Usage
This property is accepted in the main application .qmlproject file. It takes a string, and the default value is "RenderNothing".
The available options are:
"RenderNothing""Halt"
Code example:
MCU.Config {
glyphsLayoutCacheExhaustionPolicy: "Halt"
}If you are using the old (non-qmlproject) build setup, the policy can be configured by setting the CMake definition GLYPHS_LAYOUT_CACHE_EXHAUSTION_POLICY to RenderNothing or Halt.
Since
This property was introduced in QmlProject API 1.12.
See also Text caching and MCU.Config.glyphsLayoutCacheSize.
Available under certain Qt licenses.
Find out more.