chore(cli): dump-font-atlas tool for headless font inspection

A `dump-font-atlas` subcommand renders a dat Font's fg/bg atlases (alpha as
luminance) plus a sample string composited exactly the way DrawStringDat does
it (outline + fill, integer-snapped). Used to reproduce the glyph-baseline
jitter offline (fractional-origin bug vs the fix) without launching the client.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-16 15:24:37 +02:00
parent ce848c154d
commit fed838847b
2 changed files with 196 additions and 0 deletions

View file

@ -68,6 +68,20 @@ if (args.Length >= 1 && args[0] == "dump-sprite-sheet")
return VitalsMockup.ExportSheet(dssDir, dssIds, dssOut);
}
if (args.Length >= 1 && args[0] == "dump-font-atlas")
{
string? dfaDir = args.ElementAtOrDefault(1) ?? Env.GetEnvironmentVariable("ACDREAM_DAT_DIR");
string? dfaFont = args.ElementAtOrDefault(2); // 0xFontId (default 0x40000000)
string? dfaSample = args.ElementAtOrDefault(3); // sample string
string dfaOut = args.ElementAtOrDefault(4) ?? "font-atlas";
if (string.IsNullOrWhiteSpace(dfaDir))
{
Console.Error.WriteLine("usage: AcDream.Cli dump-font-atlas <dat-directory> [0xFontId] [sample] [outBase]");
return 2;
}
return FontAtlasDump.Run(dfaDir, dfaFont, dfaSample, dfaOut);
}
if (args.Length >= 1 && args[0] == "export-ui-sprite")
{
string? eusDatDir = args.ElementAtOrDefault(1) ?? Env.GetEnvironmentVariable("ACDREAM_DAT_DIR");