Skip to content

Pin salal v0.36.0: font atlases in msdf-atlas-gen's layout - #336

Merged
kcjonson merged 1 commit into
mainfrom
chore/WOR-544-salal-v0.36.0
Nov 2, 2026
Merged

kcjonson merged 1 commit into
mainfrom
chore/WOR-544-salal-v0.36.0

Conversation

@kcjonson

@kcjonson kcjonson commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Moves worldsim from salal v0.34.0 to v0.36.0, which brings fill hooks (v0.35.0), code-point fonts (v0.35.0) and display: Grid (v0.36.0).

Code-point fonts are the breaking part. From v0.35.0 salal's FontRenderer reads only msdf-atlas-gen's JSON, glyphs keyed by code point with atlas bounds in pixels, so the old fonts/*-SDF.json no longer load. The build regenerates those files from the TTFs, so converting the committed JSON alone wouldn't hold: tools/generate_sdf_atlas now writes the new layout itself. It grows each glyph's plane and atlas bounds by half the distance range and clamps them to the atlas, the padding the old FontRenderer added at load, the same math as salal's scripts/convert-font-atlas.mjs. The PNGs are unchanged, glyphs are sorted by code point, one a line, and kerning is empty as before.

  • ui::Layout now holds Grid's track lists (std::vector), which MSVC's Debug STL won't make constexpr, so the asset manager's two layout constants in AssetDetailView.cpp and GroundBakeView.cpp are const.
  • include-graph.md reads v0.36.0, and also catches up the world, assets and world-view rows that the ground tile work moved without updating it.

Text looks the same

Checked against the last build with the old font code (main at 1f46f16, salal v0.30.1), Debug, 3072x1728:

  • Every text node in the splash, main menu and settings measures the same to three decimals.
  • The splash's title (Chakra Petch), tagline (JetBrains Mono) and flavor line (Barlow) are pixel-identical (max channel delta 3 of 255).
  • The main menu's rows are pixel-identical except Quick Start, which is disabled because the test worktree had no staged planet.
  • Settings differs only in its Back button, which picked up the theme's button style from Component looks back to their pre-port character through the theme's styles #331.

The one intended change: a code point the atlases lack now draws as one ? instead of one per byte, so m² reads m? rather than m??.

Verification

  • Debug build of world-sim, ui-sandbox, asset-manager and every test target against the v0.36.0 tag; theme-tests loads all four atlases with no cramped glyphs.
  • ctest, Debug: all 13 test entries pass, heavy worldgen included. The 3 benchmark entries were not built, so they did not run.
  • Not measured: perf. v0.35.0's per-glyph code-point lookup and v0.36.0's layout changes wait for the overnight perf pass.

…ts FontRenderer reads

The atlas tool writes glyphs by code point with pixel bounds holding half the distance range, as salal's convert-font-atlas.mjs does, so text lays out as before. ui::Layout now holds Grid's tracks, so the asset manager's layout constants are const, not constexpr.
@kcjonson
kcjonson marked this pull request as ready for review November 2, 2026 22:55
Copilot AI balanced review requested due to automatic review settings November 2, 2026 22:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The salal upgrade changes per-glyph lookup and UI layout hot paths, but the required same-machine gameplay performance comparison against main remains pending.

No open issues 🎉

What changed in this PR

Updates worldsim to salal v0.36.0 and adapts font generation and asset-manager layouts to its breaking font-format and Grid changes.

Changes:

  • Migrates three font atlases and the generator to code-point glyph arrays with padded plane bounds and pixel atlas bounds, preserving existing PNGs.
  • Changes asset-manager layout constants from constexpr to const for MSVC Debug compatibility.
  • Updates the salal dependency pin and refreshes the documented include graph.
File Description
tools/​generate_sdf_atlas/​main.cpp Emits the new font JSON format with sorted glyphs and padded bounds.
fonts/​JetBrainsMono-SDF.json Migrates JetBrains Mono atlas metadata to the new format.
fonts/​ChakraPetch-SDF.json Migrates Chakra Petch atlas metadata to the new format.
fonts/​Barlow-SDF.json Migrates Barlow atlas metadata to the new format.
docs/​technical/​include-graph.md Refreshes dependency counts for salal and recent ground-tile work.
CMakeLists.txt Pins salal to v0.36.0.
apps/​asset-manager/​GroundBakeView.cpp Makes layout constants compatible with Grid’s vector members.
apps/​asset-manager/​AssetDetailView.cpp Makes layout constants compatible with Grid’s vector members.

Review effort: Balanced

@kcjonson
kcjonson merged commit ddd8a0b into main Nov 2, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants