Skip to content

UI Readability Investigation: Bitmap Font and HiDPI Improvements #113

@MichaelFisher1997

Description

@MichaelFisher1997

Summary

Following the Vulkan optimization work in Issue #112 and branch feat/vulkan-graphics, the UI is now functional with automatic scaling based on screen resolution. However, further investigation and improvements are needed for optimal readability on high-resolution displays.

Current State

Implemented

  • ✅ Automatic UI scaling based on screen height (ui_scale = screen_h / 720.0)
  • ✅ Resolution setting in Settings menu (720p to 4K presets)
  • ✅ Settings persistence to ~/.config/zigcraft/settings.json
  • ✅ Proper Wayland support with SDL_GetWindowSizeInPixels() and SDL_SyncWindow()
  • ✅ Anisotropic filtering for Vulkan textures

Known Limitations

  • Bitmap font: Current font is a 5x7 pixel bitmap rendered as individual rectangles. When scaled up, it remains blocky/pixelated by design (retro aesthetic)
  • No anti-aliasing on text: Each "pixel" of text is a solid rectangle
  • Fixed aspect ratio glyphs: Characters don't adapt to ultra-wide resolutions

Areas to Investigate

1. Font Rendering Options

  • Consider SDF (Signed Distance Field) fonts for smooth scaling
  • Evaluate stb_truetype or FreeType integration for vector fonts
  • Assess if current retro bitmap style is intentional or should be improved

2. UI Scale Refinements

  • Add manual UI scale setting (0.5x to 2.0x multiplier)
  • Test on various resolutions: 720p, 1080p, 1440p, 4K, ultrawide
  • Ensure buttons and text remain clickable at all scales

3. HiDPI / Fractional Scaling

  • Test with compositor scaling (e.g., 1.25x, 1.5x scale factors)
  • Verify pixel-perfect rendering on scaled displays

4. In-Game HUD

  • Apply same UI scaling to in-game debug overlay
  • Scale pause menu and world map UI

Test Environment

  • OS: NixOS 24.11 (Wayland/Hyprland)
  • GPU: AMD Radeon RX 5700 XT
  • Displays: 2560x1440 @ 144Hz, 2560x1080 @ 60Hz
  • Scale: 1.0 (no HiDPI scaling)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions