From b48fb2caccc7a72b85f07e6ab652081af57c7855 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 1 Dec 2026 22:32:55 +0400 Subject: feat(ui): render mission hints with the original game font Resolve the witnessed 800x600 GAME_FONT through the installed resource configuration. Draw CP1251 bytes from the Tfnt atlas using the original variable-width metrics. Checked the original measurement routine and the first Constructor hint in the game window. --- apps/fparkan-game/src/mission_hints.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'apps/fparkan-game') diff --git a/apps/fparkan-game/src/mission_hints.rs b/apps/fparkan-game/src/mission_hints.rs index 9e6e2055..3ec9c440 100644 --- a/apps/fparkan-game/src/mission_hints.rs +++ b/apps/fparkan-game/src/mission_hints.rs @@ -4,6 +4,7 @@ use super::{ EnvironmentGpuRange, LegacyBlendMode, LegacyDepthMode, StaticPreviewScene, Vfs, VulkanSmokeRenderer, VulkanStaticMesh, VulkanStaticTexture, }; +use fparkan_assets::game_font::{load_game_font, BitmapFont}; use fparkan_path::{normalize_relative, PathPolicy}; use fparkan_platform_winit::text::{caption, StringResources}; use fparkan_runtime::MissionScriptOutcome; @@ -48,6 +49,7 @@ struct MessageResources { catalog: Arc<[u8]>, strings: StringResources, sender_strings: Option, + font: BitmapFont, } impl MissionHints { @@ -163,7 +165,12 @@ impl MissionHints { self.active = None; if pager_visible(message.posted_ms, clock) { let index = message.index; - let (height, rgba) = match caption(&message.body, WIDTH, HEIGHT) { + let font = &self + .messages + .as_ref() + .expect("posted message resources") + .font; + let (height, rgba) = match font.caption(&message.body, WIDTH, HEIGHT) { Ok(caption) => caption, Err(error) => { eprintln!( @@ -266,6 +273,7 @@ impl MessageResources { catalog, strings, sender_strings, + font: load_game_font(&vfs)?, })) } } -- cgit v1.2.3