[P3-005] Replace hardcoded C:\Windows\Fonts\ paths in ImGuiController.cs · Issue #29 · r6e/FModel-Linux · GitHub
Skip to content

[P3-005] Replace hardcoded C:\Windows\Fonts\ paths in ImGuiController.cs #29

Open

Description

@r6e

Overview

Replace hardcoded C:\Windows\Fonts\ paths used for ImGui UI font loading with a cross-platform font resolution strategy.

Files Affected

  • FModel/Framework/ImGuiController.cs

Findings

  • ImGui fonts loaded from: @"C:\Windows\Fonts\segoeui.ttf", @"C:\Windows\Fonts\segoeuib.ttf", @"C:\Windows\Fonts\seguisb.ttf"
  • These paths do not exist on Linux; ImGui.GetIO().Fonts.AddFontFromFileTTF() returns null, causing the entire ImGui render pass to fail with a null-reference exception
  • Resolution options (in priority order):
    1. Bundle a permissively-licensed substitute font (e.g. Inter, Noto Sans) as an embedded resource in FModel/Resources/ → call AddFontFromMemoryTTF() from stream
    2. Probe fc-match "Segoe UI" on Linux and fall back to the system sans-serif path
  • On Windows: retain existing Segoe UI path; on Linux: use bundled/probed font

Acceptance Criteria

  • ImGui renders on Linux with a legible UI font
  • No hardcoded C:\Windows\Fonts\ path remains
  • No null ImFont crash on Linux

Effort

M (1–4 hours)

Agent

platform-abstraction-specialist

Depends On

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions