Repository navigation
Pin salal v0.36.0: font atlases in msdf-atlas-gen's layout - #336
Merged
Merged
Conversation
…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.
Contributor
There was a problem hiding this comment.
🔵 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
constexprtoconstfor 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsonno longer load. The build regenerates those files from the TTFs, so converting the committed JSON alone wouldn't hold:tools/generate_sdf_atlasnow 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'sscripts/convert-font-atlas.mjs. The PNGs are unchanged, glyphs are sorted by code point, one a line, and kerning is empty as before.ui::Layoutnow holds Grid's track lists (std::vector), which MSVC's Debug STL won't makeconstexpr, so the asset manager's two layout constants inAssetDetailView.cppandGroundBakeView.cppareconst.include-graph.mdreads 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:
The one intended change: a code point the atlases lack now draws as one
?instead of one per byte, som²readsm?rather thanm??.Verification
theme-testsloads all four atlases with no cramped glyphs.