Calibrate native text weight and advances
This commit is contained in:
@@ -2515,12 +2515,24 @@ backend-native approximation for every shipped mode-3 call because Himegari alwa
|
||||
`(1,1)` radii. The same style applicator covers live ADV, retained History, and surface text. Mode 2
|
||||
remains unimplemented and is unused by this game.
|
||||
|
||||
The remaining raster behavior is still an approximation: weight 700 uses Godot
|
||||
`VariationEmbolden=1.2`, and mode 3 does not reproduce AGE's exact sampled coverage at each ellipse
|
||||
angle. Exact GDI-compatible advances, grayscale coverage, and edge pixels require a dedicated glyph
|
||||
backend (or a deliberately calibrated approximation) behind the existing engine-owned layout/style
|
||||
contract. Portable configurable face substitutions/defaults are intentionally deferred to the broader
|
||||
runtime configuration design.
|
||||
A 2026-07-28 Windows calibration compared exact-profile GDI
|
||||
`CreateFontIndirectW`/`GetTextExtentPoint32W`/`GetGlyphOutlineW(GGO_GRAY4_BITMAP)` results with Godot's
|
||||
loaded TTCs. Six mixed kanji, kana, punctuation, full-width digit, and Latin samples found exact
|
||||
horizontal agreement for regular 24px Mincho and regular 16px Gothic. GDI also produced identical
|
||||
measurements with the native negative half-height `lfWidth` and `lfWidth=0`; no horizontal scaling is
|
||||
needed for those profiles on this installation.
|
||||
|
||||
The old `VariationEmbolden=1.2` was not a good weight-700 approximation: the sample glyph `魔` had
|
||||
coverage sum 6,651 versus native 4,615 (+44%), while complete strings remained as much as 9 pixels
|
||||
narrower than native. `VariationEmbolden=0.53` plus one pixel of glyph spacing yields coverage 4,600
|
||||
(-0.3%) and bounds all six complete-string errors to 0..3 pixels. Godot reports a 25px/17px line box
|
||||
for the native 24px/16px profiles, so presentation subtracts that one-pixel backend excess from the
|
||||
script's extra line spacing, retaining AGE's requested total line advance. The calibration is applied
|
||||
per bold font variation and through the common live/History/surface style path.
|
||||
|
||||
Mode 3 still does not reproduce AGE's exact sampled coverage at each ellipse angle. Exact per-pixel
|
||||
parity beyond the calibrated profiles requires a dedicated glyph backend. Portable configurable face
|
||||
substitutions/defaults are intentionally deferred to the broader runtime configuration design.
|
||||
|
||||
#### ADV wait indicator -- ops `0x73` / `0x72` (2026-07-11)
|
||||
|
||||
|
||||
@@ -3357,6 +3357,25 @@ records, and the Godot self-test applies both modes to a real Label and checks i
|
||||
state. Validation: engine **431/431**, zero-warning Godot build, and threaded `SELFTEST OK` with
|
||||
`text-effect-modes=ok`. User visual acceptance passed on 2026-07-28.
|
||||
|
||||
## ADV font weight and advance calibrated (2026-07-28)
|
||||
|
||||
A disposable Windows GDI oracle measured six representative strings and the grayscale `魔` glyph
|
||||
against Godot's actual `msmincho.ttc`/`msgothic.ttc` presentation. Regular 24px Mincho and 16px Gothic
|
||||
advances match exactly, so neither face receives speculative horizontal scaling. The former
|
||||
`VariationEmbolden=1.2` overshot native weight-700 glyph coverage by 44% while remaining up to 9 pixels
|
||||
narrow across a complete sample string.
|
||||
|
||||
The bold variation now uses measured `VariationEmbolden=0.53` plus one pixel of glyph spacing. Its
|
||||
grayscale coverage is within 0.3% of GDI and the six measured string widths are within 0..3 pixels.
|
||||
The shared style path also compensates for Godot reporting the two fonts' line boxes one pixel taller
|
||||
than AGE's explicit requested heights, preserving native total line advance during wrapping. The Godot
|
||||
self-test checks the calibrated variation and both 24px/16px spacing examples.
|
||||
|
||||
Validation: engine **431/431**, zero-warning Godot build, and threaded `SELFTEST OK` with
|
||||
`font-calibration=ok`. The probes were deliberately disposable; the canonical measurements live in
|
||||
`docs/engine-re.md` rather than adding a Windows-only runtime/tool dependency. User visual acceptance
|
||||
passed on 2026-07-28.
|
||||
|
||||
## Persistence native-format reconnaissance complete (2026-07-24)
|
||||
|
||||
The deferred save/profile ownership question now has a compatibility-mode answer. The remaining native
|
||||
|
||||
@@ -31,7 +31,7 @@ or replaced before claiming portable exports.
|
||||
| AGE movie decode (`0x236` scene movies; `0x20f` modal LOGO/OP/ED) | `FfmpegMovieDecoder` is the sole factory over the project-owned `native/age_movie_ffmpeg` ABI | Windows-x64 passes the complete 213-payload installed video/audio corpus gate plus audible LOGO/OP/CHAPTER playback | Add target-specific native builds and export packaging |
|
||||
| Movie integration | Each surface owns a unique playback-instance id; `MovieRuntime` owns `IMovieDecoder` from an injected factory; video-only streams use monotonic pacing while audio-bearing streams use the Godot output clock | Concurrent/restarted uses of one asset have independent frame/audio/completion/teardown state; managed code is no longer Windows-annotated, while only the win-x64 native bundle exists today | Add Linux/macOS native builds and smoke gates |
|
||||
| Movie audio | ABI v2 returns timestamped stereo float PCM; bounded managed buffering feeds a per-playback Godot `AudioStreamGenerator` and routes native movie flags to engine buses | All 29 installed audio-bearing streams decode with signal; synchronized LOGO/OP/CHAPTER playback is audibly accepted | Treat absent, distorted, or unsynchronized audio from an audio-bearing movie as a runtime bug |
|
||||
| ADV font discovery/raster fidelity | Opcode `0x1a5` reaches presentation; `godot/Main.cs` loads Windows `MS 明朝`/`MS ゴシック` from their known TTC files when available, otherwise uses the existing Japanese-font/default fallback; native mode 1 maps to one Godot shadow glyph and shipped `(1,1)` mode 3 maps to a one-pixel outline | A normal Windows install preserves Himegari's face distinction and separate displaced-effect/outline profiles; Linux/macOS normally lack the proprietary fonts, while advances, wrapping, boldness, and exact grayscale coverage still depend on the substitute/backend | Add configurable default and requested-face substitutions as part of the broader runtime configuration design; for portable distribution bundle licensed metric-compatible faces or define profile substitutions, then decide whether exact AGE grayscale rasterization warrants a custom glyph backend |
|
||||
| ADV font discovery/raster fidelity | Opcode `0x1a5` reaches presentation; `godot/Main.cs` loads Windows `MS 明朝`/`MS ゴシック` from their known TTC files when available, otherwise uses the existing Japanese-font/default fallback; native mode 1 maps to one Godot shadow glyph and shipped `(1,1)` mode 3 maps to a one-pixel outline | On the reference Windows install, regular 24px Mincho/16px Gothic advances match GDI exactly; calibrated bold coverage is within 0.3%, six-sample string drift is at most 3px, and backend line-box excess is compensated. Other platforms normally lack the proprietary faces, so substitute metrics remain profile-dependent | Add configurable default and requested-face substitutions as part of the broader runtime configuration design; for portable distribution bundle licensed metric-compatible faces or define profile substitutions, then decide whether broader exact AGE grayscale rasterization warrants a custom glyph backend |
|
||||
| Filesystem semantics | Several filename and containment comparisons use `OrdinalIgnoreCase`; installed assets are conventionally uppercase | Needs validation on case-sensitive filesystems; may hide casing or containment mistakes | Add Linux/macOS tests with mixed-case synthetic roots and use filesystem-appropriate containment rules |
|
||||
| Save/profile storage | Managed `DirectoryNativeDatStore` under Godot `user://SAVE`; native S3SD/S4SD/S3RT files and 24-bit BMP thumbnails | No Win32 path API at runtime; port saves remain isolated from the original installation | Validate replace/flush, case, permissions, and interrupted-write behavior on each export target |
|
||||
| Install/repository discovery | `engine/Age.Engine/Sys4/Paths.cs` finds `age-reimpl` above `AppContext.BaseDirectory` and assumes the current workspace sibling layout | Suitable for development, not packaged exports on any OS | Replace runtime discovery with a user-selected game root/profile; retain repository paths only for developer tools/tests |
|
||||
|
||||
Reference in New Issue
Block a user