Skip to content

Conversation

@KAMKEEL
Copy link
Owner

@KAMKEEL KAMKEEL commented Feb 7, 2026

Motivation

  • Provide an in-repo example GUI that demonstrates crisp, scalable text rendering from the existing TTF resource without adding new font assets.
  • Give a simple, client-only test entrypoint so maintainers can open the demo in-game and validate renderer behavior across GUI scale settings.

Description

  • Added a client GUI kamkeel.npcs.client.gui.GuiFontTest that draws a title, debug info (renderer path, atlas size, GUI scale, scale factor), and sample lines at sizes 8, 12, 16, 24, 32, 48, 64 with baseline guide lines for alignment verification.
  • Implemented kamkeel.npcs.client.renderer.font.ScalableFontRenderer which loads assets/customnpcs/OpenSans.ttf from the classpath, builds an SDF atlas and uses an OpenGL shader path for sharp scaling, and falls back to true per-size rebaking (cached atlases) if shader setup fails; texture parameters use linear filtering and CLAMP_TO_EDGE and GL state is preserved around rendering.
  • Added a client-only packet GuiFontTestOpenPacket and a new data packet enum value so the GUI can be opened from server-side code, and added kamkeel.npcs.command.TestCommand registered under Kamkeel commands to expose /kamkeel testfont for players.
  • Minimal touches to existing registries: packet enum/registration and CommandKamkeel command list updated to wire the packet and command into existing systems.

Testing

  • Initialized repository submodules and prepared the workspace, discovered the existing font at src/main/resources/assets/customnpcs/OpenSans.ttf.
  • Compiled the project with ./gradlew compileJava and confirmed a successful build: BUILD SUCCESSFUL (no Java compile errors reported).
  • No automated runtime/integration tests were added because the change is a client-side GUI feature that requires running the mod in Minecraft to fully validate rendering; compile-time checks passed.

Codex Task

@KAMKEEL KAMKEEL closed this Feb 7, 2026
@KAMKEEL KAMKEEL deleted the add-example-gui-for-scalable-text-rendering branch February 7, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant