fix retained glyph bottom clipping

This commit is contained in:
gamer147
2026-07-30 20:29:39 -04:00
parent d9f24c69ef
commit 49722c55fe
9 changed files with 185 additions and 13 deletions

View File

@@ -2894,6 +2894,16 @@ The shipped effect profiles use only modes 1 and 3:
`360 / (sqrt(effect_x²+effect_y²)*8)`, blits the effect-colored glyph at every rounded offset, then
draws the primary glyph. All 164 paired sites use `(1,1)`, producing the normal one-pixel outline.
**Measured cell versus raster ink (2026-07-30).** `adv_text_build_glyph_records@0x4576c0` stores
the `GetTextExtentPoint32A` measured cell edges in each retained record, and
`adv_text_publish_next_glyph@0x451220` uses those edges when it binds the native object.
`text_raster_string_cached@0x45b600`, however, composites the complete `GetGlyphOutlineA` black-box
bitmap and effect copies into the shared layout surface. Direct 24-pixel bold Mincho probes show several
ordinary Japanese glyphs reaching below the 24-pixel measured cell even before the mode-3 `(1,1)` outline.
Thus the record is a layout/publication cell, not a guaranteed ink bounding box. The port preserves that
native record and derives a separate transient vertical publication crop from mask origin/height and effect
offsets; its horizontal crop remains the measured cell to avoid exposing the next glyph during timed reveal.
The ordinary ADV preset is therefore 24-pixel ` 明朝`, weight 700, white fill, mode-3 `(1,1)` outline
in `0x606060`, with 8 pixels of line leading. The small menu-description preset is 16-pixel
` ゴシック`, weight 0, white fill, mode 1 with zero displacement, and 9 pixels of leading.

View File

@@ -3674,6 +3674,15 @@ surface's z-order, alpha, tint, fade, transform, clipping, capture, and lifetime
Validation: engine **580/580**, zero-warning Godot build, and threaded `SELFTEST OK` in both forced
`portable-godot-textserver` and forced `windows-gdi-gray4` modes.
**Bottom-edge clipping follow-up (2026-07-30):** retained publication originally reused the native
measured-cell rectangle as its exact source crop. Direct GDI probing confirmed that the glyph black-box
bitmap, plus the mode-3 outline, can extend below that cell even though the pixels are present in the
layout surface. The native `AdvRetainedGlyphRecord` remains unchanged for layout and reconstruction; each
transient placement now carries a separate vertically ink-safe publication rectangle. Horizontal edges
remain cell-bounded so timed reveal cannot expose a neighboring glyph. Synthetic compositor/publication
regressions pass, the Godot build is clean, and forced exact and portable self-tests both report
`SELFTEST OK`.
## Persistence native-format reconnaissance complete (2026-07-24)
The deferred save/profile ownership question now has a compatibility-mode answer. The remaining native

View File

@@ -627,7 +627,10 @@ primitive, which cannot be made equivalent by choosing another embolden constant
per-run origins, partial erase/republication, suspension, measured cursor handoff, reset, and
reconstruction. The synthesized Godot VM self-test exercises timed exact reveal and reports
`live-adv-text=retained-glyphs`; real GPU captures of SC0000 pages 1 and 7 confirm ordinary and voiced
dialogue placement/wrapping alongside the immediate speaker-name surface.
dialogue placement/wrapping alongside the immediate speaker-name surface. A 2026-07-30 clipping
follow-up keeps those native measured-cell records intact but gives transient placements a separate
vertically ink-safe source crop, because backend glyph black boxes and mode-3 outlines can extend below
the measured cell; horizontal crops remain cell-bounded to preserve reveal isolation.
6. **Migrate History and the ADV wait indicator through the same retained path. — Completed
2026-07-30.** Op `0x1d1` now rasterizes each HISTORY row into its target layout surface and publishes its
native glyph interval through ordinary `GfxState` bindings. Row reset, wheel redraw, the broad native exit
@@ -645,7 +648,8 @@ primitive, which cannot be made equivalent by choosing another embolden constant
sizes. `auto` selects exact GDI when its ACP-932 gate passes and otherwise selects the explicitly
non-pixel-exact Unicode backend; development runs can force either with `--text-backend`. Both modes pass
the same immediate/live/History retained-glyph self-test. Gameplay `Label` pools and surface-text overlay
projection are removed, so text always participates in the ordinary surface compositor.
projection are removed, so text always participates in the ordinary surface compositor. Publication uses
the transient ink-safe crop established in step 5 in both backends.
**Acceptance gates:**