CHARCODEDESC
struct · font · 112 bytes
- Meaning
- Holds a cached glyph: its atlas cell, metrics and UV rectangle
- Confidence
- verified, proof one
- Finding
- font/glyphs#finding-or-making-a-glyph
Finding: Finding or making a glyph in font: glyph cache and atlas
0x5cabd0(code) returns the cached descriptor of a character code, making it when missing. A hit
moves the descriptor to the front of the recency list. A miss rasterizes the glyph, places it
in a page (making a page if needed, evicting the least recently used glyph when the pages are
full) and enters it in the hash.
The derivation is in the doc.
Fields 10
| offset | size | type | name | meaning | confidence | finding |
|---|---|---|---|---|---|---|
0x0000 | 4 | uint32_t | m_code | Holds the character code | verified, proof one | font/glyphs#finding-or-making-a-glyph |
0x0028 | 4 | int32_t | m_page | Holds the atlas page index, -1 before placement | verified, proof one | font/glyphs#finding-or-making-a-glyph |
0x002c | 4 | int32_t | m_row | Holds the atlas row, -1 before placement | verified, proof one | font/glyphs#finding-or-making-a-glyph |
0x0030 | 4 | int32_t | m_cellX0 | Holds the first texel column of the cell | verified, proof one | font/glyphs#finding-or-making-a-glyph |
0x0048 | 4 | int32_t | m_advance | Holds the integer pixel advance | verified, proof one | font/metrics#glyph-width-and-step-base |
0x004c | 4 | float | m_stepBase | Holds the step base metric | verified, proof one | font/metrics#glyph-width-and-step-base |
0x0050 | 4 | float | m_width | Holds the width metric | verified, proof one | font/metrics#glyph-width-and-step-base |
0x0058 | 4 | int32_t | m_gap | Holds the rows the glyph's quad is raised by, negative when its ink overflows the cell | verified, proof one | font/glyphs#glyph-vertical-terms |
0x005c | 4 | uint32_t | m_topPad | Holds the blank rows above the ink in the cell | verified, proof one | font/glyphs#glyph-vertical-terms |
0x0060 | 16 | float[4] | m_uv | Holds v_top, u_left, v_bottom and u_right of the cell, each over 256 | verified, proof one | font/glyphs#pages-and-cells |