fix(runtime): embed Chinese font in P9.2 battle

This commit is contained in:
2026-08-14 10:35:48 +08:00
parent f073d845e1
commit 48228b3843
4 changed files with 44 additions and 5 deletions
+14
View File
@@ -34,6 +34,13 @@ Owned files:
```text
docs/runtime/p9_2/OWNER_PLAY_REPORT.md
docs/runtime/p9_2/IMPLEMENTATION_PLAN.md
docs/runtime/p9_2/H5_DELIVERY.md
docs/runtime/p9_2/FONT_REPAIR_EVIDENCE.md
docs/reviews/PHASE9_GODOT_VERTICAL_SLICE_LEDGER.md
CURRENT_CHECKPOINT.md
runtime/main.gd
runtime/tests/p9_2/horizontal_battle_runtime_test.gd
```
Required acceptance:
@@ -47,6 +54,12 @@ Required acceptance:
- At most one bounded P9.2 repair batch follows direct Owner feedback. Permanent
casualty/save, content expansion, packaging and release remain frozen.
Bounded repair batch `P92-R1` is active for the Owner-reported P9.2 Chinese
missing-glyph screen. It may only bind the already-embedded Noto Sans SC theme
to the outer runtime tree, add a focused theme/glyph regression, regenerate the
runtime-only H5, and update the source-bound delivery record. It may not change
battle behavior, copy, layout, assets or any frozen system.
## Issue Register
| ID | Status | Boundary | Disposition |
@@ -54,6 +67,7 @@ Required acceptance:
| P92-I01 | `OPEN` | P9.1 battles are deterministic presentation fixtures rather than a reusable authoritative combat loop. | Step 1 builds an isolated P9.2 domain without rewriting P9.1. |
| P92-I02 | `OPEN` | Existing product authorities contain later full-game casualty/save rules beyond this milestone. | P9.2 freezes permanent settlement and records only run-local survivors. |
| P92-I03 | `OPEN` | Gallery H5 cold start is multi-minute. | P9.2 reached the real 844x390 Title in about 180 seconds with browser warnings/errors zero. Cache improves repeat use; bundle/host optimization remains a later delivery task, not a gameplay claim. |
| P92-I04 | `IN_PROGRESS` | Owner screenshot shows all Chinese glyphs become missing-glyph boxes after the preserved P9.1 flow enters P9.2. Digits and Latin glyphs remain readable. | The font and imported font data are present in the Web PCK; P9.1 applies the embedded theme only to the nested facade, while the P9.2 presenter mounts under the unthemed outer runtime root. Repair `P92-R1` binds that exact existing theme at the outer root and adds a focused Chinese-glyph inheritance regression. |
## Stopping Rule
+16 -4
View File
@@ -1,6 +1,6 @@
# P9.2 Owner Play Report
> Status: `AWAITING_OWNER_PLAY`
> Status: `OWNER_FEEDBACK_REPAIR_IN_PROGRESS`
> Candidate: `df187aafd5fff1ba71c76a80b11f19f29bb7e17f`
> Gallery item: `GAbcudVktgvh`
@@ -19,6 +19,18 @@
## Recorded Observation
Awaiting Owner feedback. Automated/runtime evidence cannot fill this section or
upgrade human understanding, fun, visual/control feel or willingness to
continue.
On 2026-08-14 the Owner reached the P9.2 battle through the private H5 and
reported that "the later part becomes garbled." The supplied 2048x1142
landscape screenshot shows every Chinese character as a missing-glyph box while
digits and Latin `x` remain readable. This blocks all P9.2 comprehension and
invalidates the current H5 as an Owner-play candidate even though its bundle is
reachable.
Source inspection found that the existing embedded `NotoSansSC.ttf` and its
imported font data are present in the Web PCK. The preserved P9.1 facade binds
that font to its own nested theme, but the new P9.2 presenter mounts under the
outer runtime root, which has no theme. `P92-R1` is the one bounded Step 5 repair
batch: inherit the same embedded theme at the outer root, add a Chinese glyph
regression, re-export, and re-publish. Automated evidence cannot close the
Owner's comprehension, fun, visual/control feel or willingness-to-continue
gates after the repair.
+1
View File
@@ -197,6 +197,7 @@ func _ready() -> void:
facade.name = "RuntimeFacade"
facade.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
add_child(facade)
theme = facade.theme
facade.authoritative_battle_requested.connect(start_authoritative_battle)
authoritative_battle_presenter = P92BattlePresenterScript.new(self)
@@ -37,6 +37,7 @@ func run_test() -> void:
_finish()
return
_expect(not game.facade.visible, "legacy facade is hidden during P9.2")
_assert_embedded_chinese_font()
var initial: Dictionary = game.authoritative_battle_service.state.current_snapshot()
_expect(initial.members.ids == ["Hearthguard", "Farstring", "Kindhand"], "P9.1 field order imports")
_expect(initial.members.hp == {"Hearthguard": 72, "Farstring": 46, "Kindhand": 85}, "P9.1 end HP imports")
@@ -72,7 +73,7 @@ func run_test() -> void:
func _finish() -> void:
if failures.is_empty():
print("ABG_P9_2_HORIZONTAL_BATTLE_RUNTIME_OK viewport=844x390 source=p9_1_result members=3 hp_import=true movement=true contact=true member_events=true enemy_events=true outcome=victory domain_bound=true")
print("ABG_P9_2_HORIZONTAL_BATTLE_RUNTIME_OK viewport=844x390 source=p9_1_result members=3 hp_import=true movement=true contact=true member_events=true enemy_events=true outcome=victory domain_bound=true embedded_font=true")
quit(0)
else:
for failure in failures:
@@ -91,6 +92,17 @@ func _prepare_p9_1_result() -> void:
game.facade.session_state.member_levels = {"Hearthguard": 2, "Farstring": 1, "Kindhand": 1}
game.page = game.AppPage.THIRD_CYCLE_RESULT
func _assert_embedded_chinese_font() -> void:
var battle_root: Control = game.authoritative_battle_presenter.root
var embedded_font: Font = game.facade.UI_FONT
_expect(game.theme != null, "outer runtime root owns the embedded UI theme")
_expect(game.theme == game.facade.theme, "outer runtime inherits the facade UI theme")
_expect(game.theme.default_font == embedded_font, "outer runtime binds the embedded Noto Sans SC font")
_expect(battle_root.get_theme_default_font() == embedded_font, "P9.2 tree inherits the embedded font")
_expect(embedded_font.has_char("裂".unicode_at(0)), "embedded font contains the P9.2 Chinese title glyph")
var title: Label = find_control(battle_root, "P92BattleTitle")
_expect(title != null and title.get_theme_default_font() == embedded_font, "P9.2 title resolves the embedded font")
func _assert_runtime_binding(label: String) -> void:
var snapshot: Dictionary = game.authoritative_battle_service.state.current_snapshot()
var battle_root: Control = game.authoritative_battle_presenter.root