Identity of one unique glyph outline: every input that can change the encoded geometry, and nothing that cannot. More...
#include "donner/svg/renderer/geode/GeodeGlyphResidency.h"
Public Member Functions | |
| bool | operator== (const GlyphGeometryKey &other) const |
| Compare every key field by raw bits, including signed zero and NaN payloads. | |
Identity of one unique glyph outline: every input that can change the encoded geometry, and nothing that cannot.
fontId is the font handle's opaque identifier, outlineScale is the effective scale handed to the font backend (the run scale times the glyph's own font-size multiplier), the stretch factors are the lengthAdjust scale, and rotateDegrees is the per-glyph rotation - all four are baked into the outline before placement. Position is deliberately absent: it is the placement transform, which rides in the per-occurrence record.
Rotation belongs here rather than in the placement because a resident outline is also the space its rasteriser works in, and that space has to stay aligned with the pixel grid. The cost is one cached outline per distinct angle: a whole run rotated by one angle still collapses to one entry, and a textPath, which rotates every glyph differently, degrades to about one entry per glyph - which is what an uncached renderer pays anyway.
The numeric fields are compared and hashed BITWISE, matching how they reach the font backend: two scales or angles that differ in the last bit produce different outlines, so they must not share an entry.
fontId carries the font handle's version bits, so an unloaded font whose slot is later reused cannot be mistaken for the original. It is also not stable when a different face is selected. An outline-only synthesis change can keep the same face, so its per-glyph permission is also part of the key. Superseded entries age out through the residency budget.
|
inline |
Compare every key field by raw bits, including signed zero and NaN payloads.
| other | Geometry key to compare. |