BrendonButler / BrendonButler/entropy
[Feature] Implement bitmap font text renderer for 2D orthographic pipeline
- Dominant language
- Java
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
### Description of the Feature
Implement a bitmap font text rendering system integrated with the existing 2D orthographic pipeline. The system should support loading BMFont \`.fnt\` + texture atlas files, performing per-character glyph layout, and rendering text via a dedicated text shader and batch renderer.
### Scope
**In scope for this story:**
- \`FontLoader\` utility that parses BMFont \`.fnt\` text format into the existing \`Font\`/\`Glyph\` data model
- Concrete \`Text2D\` class (extends \`RenderableText\`) with text string, position, scale, and color
- Text vertex/fragment shaders that sample the font atlas per glyph
- \`TextShader\` extending \`ShaderProgram\` with text-specific uniforms
- \`RenderBatchText\` fully wired to the text shader and atlas, performing glyph layout and rendering
- \`Render2D.renderText()\` method exposing text rendering through the existing renderer
- \`DemoRender2D\` updated to render text on screen
- Unit tests for \`FontLoader\`, \`Text2D\`, and \`RenderBatchText\`
**Explicitly out of scope (tracked separately):**
- 3D text / perspective rendering
- Text wrapping and alignment
- Localization and i18n
- TrueType/FreeType support
- Applying text to 3D model surfaces
### Benefits of the Feature
1. Enables dynamic text rendering in HUDs, menus, and dialog boxes
2. Keeps font logic decoupled from core rendering
3. Integrates cleanly with the existing \`Render2D\` pipeline
### Acceptance Criteria
- [ ] \`FontLoader\` correctly parses a BMFont \`.fnt\` file into a \`Font\` record
- [ ] \`Text2D\` instances can be submitted to \`RenderBatchText\` and rendered to screen
- [ ] Text color is controllable via the \`Text2D\` color property
- [ ] \`DemoRender2D\` displays at least one text string using a bitmap font
- [ ] Unit tests cover font loading and glyph layout
- [ ] All public classes and methods have JavaDoc
Contributor guide
Assessment
This issue has not been assessed yet.