struct GlyphCacheParams { unsigned TextureWidth; unsigned TextureHeight; unsigned NumTextures; unsigned MaxSlotHeight; unsigned SlotPadding; unsigned TexUpdWidth; unsigned TexUpdHeight; float MaxRasterScale; unsigned MaxVectorCacheSize; float FauxItalicAngle; float FauxBoldRatio; float OutlineRatio; float ShadowQuality; bool UseAutoFit; bool UseVectorOnFullCache; bool FenceWaitOnFullCache; };
GlyphCacheParams describes the texture use policy of the dynamic glyph cache. By modifying elements of this structure, developers can change the behavior of the dynamic cache as well as the allowed memory consumption.
The glyph cache is used for rasterizing fonts, allowing them to be drawn efficiently from textures. Glyph cache is updated dynamically and has a fixed size determined at initialization time. TextureWidth, TextureHeight, and NumTextures define the size and number of alpha-only textures that will be allocated. MaxSlotHeight specifies the maximum height of a slot, in pixels, that will be allocated for a single glyph.
Data Member |
Description |
A multiplier of the nominal font size used to make the text bold on demand. By default, .045f i.e., 4.5% of the font size. | |
Angle in radians that is used to make the text italic on demand. By default is 0.25f or about 17 degrees. | |
If true, the glyph cache wait until the GPU is no longer using slots, so they can be evicted. Otherwise, full cache is reported. This only occurs when using more than the entire glyph space during a single frame of rendering. | |
Multiplier of maximum texture slot size, in pixels, after which the glyph vectorization will occur, by default 1.0f. | |
The maximal height of the glyphs, by default 48 pixels. The actual pixel glyph height cannot exceed this value * MaxRasterScale. Bigger glyphs are rendered as vector shapes. | |
Maximum number of glyphs stored in the vector glyph cache. MaxVectorCacheSize defines the vector glyph cache capacity. The vector glyph cache is used when glyphs are rendered as vector shapes. | |
The number of font cache textures used for caching. | |
Outline width of the fonts to control the outline effect on large and small texts, by default 0.01f which corresponds to 1% of the font size. | |
| |
The marginal value used to prevent clipping and overlapping of the glyphs. The value of 2 is good enough in most practical cases. | |
The height of the caching textures in pixels; this value is rounded to the nearest greater power of two. | |
The width of the caching textures in pixels; this value is rounded to the nearest greater power of two. | |
The height of the image used to update the texture. | |
The width of the image used to update the texture. | |
A Boolean flag to enable/disable the auto fitting operation (auto hinting) where the glyphs are automatically snapped to the pixel grid to reduce blurriness. By default, set to true when anti-alias for readability is used. | |
When the raster cache size is too small some text fields may fail to render. UseVectorOnFullCache=true enables vector rendering when the raster cache is full. |
Method |
Description |
GlyphCacheParams constructor. |
Render_GlyphCacheConfig.h