[PR #1092] [MERGED] Prepare: import the Unifont glyphs from the asset index #3041

Closed
opened 2026-11-02 16:01:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1092
Author: @ludovic111
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @ludovic111

Base: main ← Head: fix/prepare-unifont


📝 Commits (1)

  • b5c7c57 Prepare: import the Unifont glyphs from the asset index (#1076)

📊 Changes

3 files changed (+84 additions, -18 deletions)

View changed files

📝 crates/horizon-prepare/src/lib.rs (+6 -5)
📝 crates/horizon-prepare/src/main.rs (+7 -2)
📝 crates/horizon-prepare/src/sounds.rs (+71 -11)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Stacked on #1091 (it uses that PR's asset-index handling); review that one first.

What

The default font's GNU Unifont fallback was never imported, so every character the bitmap fonts lack (a server's ▸ separator, many symbols and scripts) showed as a missing-glyph box. Found and reported by @ItsPotatoTime in #1076.

Why

The client JAR ships an empty assets/minecraft/font/include/unifont.json ({"providers": []}). The real provider list and font/unifont.zip, unifont_jp.zip, unifont_pua.zip (1.9 MB) come only from the asset index, and horizon-prepare copied only sounds and the title panorama from it.

How

  • horizon-prepare: fonts() copies every minecraft/font/* object of the asset index (requiring include/unifont.json and unifont.zip), each checked against its SHA-1, over the JAR's empty include.
  • Full preparation imports them right after extracting the JAR, next to the panorama (optional_assets; still optional, one log line when the launcher store is unavailable).
  • horizon-prepare fonts repairs already-prepared resources without Java, like horizon-prepare panorama.

The client already reads unihex providers (font.rs load_hex); it just never had them.

Proof

Real data (the five font objects of Mojang's 26.3 index, SHA-1 checked, over resources extracted from the 26.3 client JAR):

before: font/include/unifont.json = {"providers": []}, no font/unifont*.zip
$ horizon-prepare fonts --root <scratch> --minecraft-dir <launcher store>
Font assets ready: 5 files, 1.9 MB
after:  include/unifont.json lists the unihex providers (unifont_jp.zip, unifont.zip, ...); unifont.zip, unifont_jp.zip, unifont_pua.zip present

Self-check (Mac mini):

cargo fmt --all --check                                   OK
set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings   OK
cargo test -p horizon-prepare                             24 passed (new: fonts_replace_the_jar_include_and_add_unifont; the optional-step test now covers fonts)

tools/parity.py --changed origin/main: horizon-prepare feeds every harness (324 of 325 selected), left to CI's parity job.

Needs Ludovic

Nothing; players get it with the next game release (or horizon-prepare fonts).

Fixes #1076

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1092 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/prepare-unifont` --- ### 📝 Commits (1) - [`b5c7c57`](https://github.com/horizon-rust/horizon/commit/b5c7c5789a191a3a1b1c47cfcdbb1fde669a2ee0) Prepare: import the Unifont glyphs from the asset index (#1076) ### 📊 Changes **3 files changed** (+84 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-prepare/src/lib.rs` (+6 -5) 📝 `crates/horizon-prepare/src/main.rs` (+7 -2) 📝 `crates/horizon-prepare/src/sounds.rs` (+71 -11) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Stacked on #1091 (it uses that PR's asset-index handling); review that one first. ## What The default font's GNU Unifont fallback was never imported, so every character the bitmap fonts lack (a server's `▸` separator, many symbols and scripts) showed as a missing-glyph box. Found and reported by **@ItsPotatoTime** in #1076. ## Why The client JAR ships an empty `assets/minecraft/font/include/unifont.json` (`{"providers": []}`). The real provider list and `font/unifont.zip`, `unifont_jp.zip`, `unifont_pua.zip` (1.9 MB) come only from the asset index, and `horizon-prepare` copied only sounds and the title panorama from it. ## How - `horizon-prepare`: `fonts()` copies every `minecraft/font/*` object of the asset index (requiring `include/unifont.json` and `unifont.zip`), each checked against its SHA-1, over the JAR's empty include. - Full preparation imports them right after extracting the JAR, next to the panorama (`optional_assets`; still optional, one log line when the launcher store is unavailable). - `horizon-prepare fonts` repairs already-prepared resources without Java, like `horizon-prepare panorama`. The client already reads `unihex` providers (`font.rs` `load_hex`); it just never had them. ## Proof Real data (the five font objects of Mojang's 26.3 index, SHA-1 checked, over resources extracted from the 26.3 client JAR): ``` before: font/include/unifont.json = {"providers": []}, no font/unifont*.zip $ horizon-prepare fonts --root <scratch> --minecraft-dir <launcher store> Font assets ready: 5 files, 1.9 MB after: include/unifont.json lists the unihex providers (unifont_jp.zip, unifont.zip, ...); unifont.zip, unifont_jp.zip, unifont_pua.zip present ``` Self-check (Mac mini): ``` cargo fmt --all --check OK set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings OK cargo test -p horizon-prepare 24 passed (new: fonts_replace_the_jar_include_and_add_unifont; the optional-step test now covers fonts) ``` `tools/parity.py --changed origin/main`: horizon-prepare feeds every harness (324 of 325 selected), left to CI's parity job. ## Needs Ludovic Nothing; players get it with the next game release (or `horizon-prepare fonts`). Fixes #1076 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:01:02 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3041
No description provided.